can i use struts 2 tags in a struts 1 app?

Discussion in 'Java' started by John M, Mar 6, 2008.

  1. John M

    John M Guest

    hey all,

    full on migration to struts 2 is a long ways away for our web app.
    but in the meantime, it would be great to use some of the struts2 tags
    (and thus the very flexible OGNL) in our current jsp's. obviously,
    tags like s:action won't work, but i'm wondering if i can somehow
    quickly get
    the value stack present, and then push and pop my own values and take
    advantage of stuff like the iterator and generator tags.

    to be clear, i'm not looking to migrate. just want to be able to use
    some
    struts 2 tags in our current struts 1 codebase.

    anyone know?

    thanks!
    -john
    John M, Mar 6, 2008
    #1
    1. Advertising

  2. John M

    Lew Guest

    John M wrote:
    > hey all,
    >
    > full on migration to struts 2 is a long ways away for our web app.
    > but in the meantime, it would be great to use some of the struts2 tags
    > (and thus the very flexible OGNL) in our current jsp's. obviously,
    > tags like s:action won't work, but i'm wondering if i can somehow
    > quickly get
    > the value stack present, and then push and pop my own values and take
    > advantage of stuff like the iterator and generator tags.
    >
    > to be clear, i'm not looking to migrate. just want to be able to use
    > some
    > struts 2 tags in our current struts 1 codebase.


    I don't know about "generator" tags, but can't you use JSTL for iterator tags?

    I suspect that Struts 2 won't play well with version 1, but I've never tried
    it so I don't know. I have routinely mixed JSTL and Struts 1 tags and that
    works just fine. In fact, I won't use Struts tags if there's a
    (near-)equivalent JSTL tag available.

    <jsp:useBean>, <c:forEach>, <c:if>, to name a few.

    Combining JSTL with EL (Expression Language), there's really no need for most
    Struts 1.x tags. And you're more standard.

    --
    Lew
    Lew, Mar 7, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. jc1771
    Replies:
    0
    Views:
    392
    jc1771
    Dec 28, 2003
  2. Mike
    Replies:
    3
    Views:
    865
    Michael Borgwardt
    Jan 9, 2004
  3. Claude Miller
    Replies:
    0
    Views:
    307
    Claude Miller
    Jan 11, 2004
  4. A. Brinkmann
    Replies:
    2
    Views:
    1,065
    A. Brinkmann
    Apr 16, 2004
  5. Greg Smith
    Replies:
    35
    Views:
    3,167
    Alex Kay
    Oct 24, 2004
Loading...

Share This Page