Hi all.

I'm working on a moderately large webapp based on Struts 1.0 (nightly
build from 12/4), and I've run into a situation I can't figure out how
to handle cleanly using <bean:message>.

What I have is a sentance in which only some words are hyperlinked to
other pages within the app. The sentance has to be localizable, and
the hyperlink potentially needs to be rewritten to include the webapp
context path and session id.

The problem, of course, is that

<bean:message key="foo" arg="uri">

won't work, because I can't use <form:rewrite> for the uri arg.

Any ideas?

Also, how do you experts handle the issue of localizable messages
involving a count, as in

  There are {0} messages waiting.

If {0} is zero, I'd like it to read

  There are 0 messages waiting.

If {0} is one, I'd like it to read

  There is 1 message waiting.

If {0} is two or greater, I'd like it to read

  There are n messages waiting.

Do I *have* to break down and use a scriplet just to pick the right
message from the bundle, one for n=1 and one for the other cases? Are
there going to be problems with that approach in other languages (I
would think so)? Should I be constructing this particular piece of text
in the preceding Action class, and passing it as a session or request
attribute?

What's your approach to this cases?

-- Erik


Reply via email to