Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Simple Struts question: how can I add the value of a bean variable to arg0 of the bean:message tag?

Reply
Thread Tools

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

 
 
Thomas P. Fuller
Guest
Posts: n/a
 
      08-16-2004
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
 
Reply With Quote
 
 
 
 
bitbucket43
Guest
Posts: n/a
 
      08-17-2004
Thomas P. Fuller wrote:
<snip>
> <bean:message key="homepage.welcome.text"
> arg0="loginFormBean.userName"/>


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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
(struts/JSTL) Setting bean property value with jstl choose compoundresults DaFoot Java 1 10-23-2008 12:42 PM
Cannot find child element: arg0 Frank Java 1 01-23-2008 05:35 PM
Struts - bean:write or html:text - not getting bean value - Please help jill Java 5 12-15-2005 03:03 PM
can a session bean return a local entity bean object? David Thielen Java 2 09-12-2003 07:45 AM
To bean or not to bean... Benjamin Stewart Java 0 06-30-2003 12:34 AM



Advertisments