Simple Struts question: how can I add the value of a bean variable to arg0 of the bean:message tag?

T

Thomas P. Fuller

Hi, any help with the following is much appreciated:

I'd like to add the value of a bean variable into arg0 of the
bean:message tag in the following way:

The following works:

<bean:write name="loginFormBean" property="userName"/>
results in, for example,

tfuller

and

<bean:message key="homepage.welcome.text"/>
results in, for example:

Welcome back {0}, we're happy to see you again!

Now I need to figure out how I can do the equivalent of (this does NOT
work):

<bean:message key="homepage.welcome.text"
arg0="loginFormBean.userName"/>

which should give me:

Welcome back tfuller, we're happy to see you again!

I figure this should be pretty easy, but I'm having a bit of trouble
with it; I'm new to Struts, so this is probably the reason why.

Thanks,

Thomas
 
B

bitbucket43

Thomas P. Fuller wrote:
<bean:message key="homepage.welcome.text"
arg0="loginFormBean.userName"/>

<bean:message key="homepage.welcome.text"
arg0="<%= loginFormBean.userName %>" />
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,040
Latest member
papereejit

Latest Threads

Top