Hello struts experts,

I can't get a submit button to work which uses a <bean:message> for a
localized button text _and_ a request parameter at the same time. I have
browsed the mail archive, but haven't found a solution for this. Maybe one
of you can tell me the way to achieve my goal:

A form on my page contains several submit buttons, which trigger different
actions (like 'Create', 'Search' and 'Cancel'). To circumvent the problem of
a single action target in a form I did add a request parameter to each
submit button (as suggested earlier in this mailing list):

  <html:submit property="action" value="search">
    Search
  </html:submit>

Because my application has to support different languages (like English and
German), I also use the <bean:message> tag to set the button text according
the Locale setting in the session:

  <html:submit>
    <bean:message key="searchbutton"/>
  </html:submit>

Each of the above code samples works well, like it's described in the
documentation and as I expected it.

But if I try to combine both techniques to get a multilingual submit button
with a request parameter, like in:

  <html:submit property="action" value="search">
    <bean:message key="searchbutton"/>
  </html:submit>

it does not work: Instead of my desired result - a button with a (german)
label 'Suchen', which submits a request parameter 'action=search' - I do get
a button labeled 'search' (with a lowercase 's'). The 'value' attribute
seems to be used used twice _with a different meaning_.

The Struts <html> taglib guide says under 'Common Form Tag Attributes':

"value : Value of the label to be used with this element. This value will
also be submitted as the value of the specified request parameter."

As far as I understand this sentence, it says that the 'value' attribute is
used twice for different purposes: For the label of the button and for the
request parameter value.

Have I done something wrong or misunderstood something? Or is this a slight
design flaw in the i18n support (using the same attribute twice)? Does
someone know a solution or workaround for this problem?

Regards

Christian Rosner
Software Architect



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to