[JSP] Strings Constants from JSP using Struts tags

Discussion in 'Java' started by Matthias Nietz, Nov 12, 2003.

  1. Hey NG,

    is there a way to share String Constants through an application without
    coding Java in the JSPs?
    <html:submit property="<%=CONSTANTS.anmeldetext%>" value="..."/>

    It would already be happy if I could the Application-Resource keys here but
    I can't nest the <bean:message> for <%=...%> into the <html:submit> tag. I
    want to make sure that my Actionclass uses the same String to retrieve the
    property from the request than used to declare it in the jsp. Is there
    another way to achieve my aim?

    Regards,

    Matthias.
    Matthias Nietz, Nov 12, 2003
    #1
    1. Advertising

  2. Matthias Nietz

    VisionSet Guest

    "Matthias Nietz" <> wrote in message
    news:botj8p$1gvf8p$-berlin.de...
    > Hey NG,
    >
    > is there a way to share String Constants through an application without
    > coding Java in the JSPs?
    > <html:submit property="<%=CONSTANTS.anmeldetext%>" value="..."/>
    >
    > It would already be happy if I could the Application-Resource keys here

    but
    > I can't nest the <bean:message> for <%=...%> into the <html:submit> tag.

    I
    > want to make sure that my Actionclass uses the same String to retrieve the
    > property from the request than used to declare it in the jsp. Is there
    > another way to achieve my aim?
    >


    Then there are the action form decalaration of properties in the
    struts-config.xml

    So you have 3 variables for the same property in jsp, xml, and model. jsp &
    model versions can at least be homologous, one method is to use reflection
    to lift out constants from an interface or wherever, and store them as
    context attributes at startup.

    --
    Mike W
    VisionSet, Nov 12, 2003
    #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. Mike
    Replies:
    3
    Views:
    863
    Michael Borgwardt
    Jan 9, 2004
  2. A. Brinkmann
    Replies:
    2
    Views:
    1,065
    A. Brinkmann
    Apr 16, 2004
  3. Greg Smith
    Replies:
    35
    Views:
    3,166
    Alex Kay
    Oct 24, 2004
  4. koslows
    Replies:
    0
    Views:
    523
    koslows
    May 12, 2005
  5. John M
    Replies:
    1
    Views:
    734
Loading...

Share This Page