aspose file tools*
The moose likes Struts and the fly likes getting error with bean:message tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "getting error with bean:message tag" Watch "getting error with bean:message tag" New topic
Author

getting error with bean:message tag

Kumar Sushil
Greenhorn

Joined: Jan 31, 2006
Posts: 29
Hi All,

I am using <bean:message> tag, but it is not accepting any dynamic value for arg.

<bean:message bundle="product.loader" key="gfasload.already1" arg0="<bean:write name ='loadInvestmentForm' property='code'> </bean:write>"/>

If i write out side <bean:write name ='loadInvestmentForm' property='code'> </bean:write> the its giving me value, but inside <bean:message/> not giving.

thanks in advance.
Kumar Sushil
Greenhorn

Joined: Jan 31, 2006
Posts: 29
Can any body help me on this?
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

Actually I`m too not able to find out solution for it ..

like many time I want to display the results in input field ,
so in struts I ended up writing something like this ,



but this wont compile , So I need to write something like as classic html



this complies and works fine ..

May be If you are loading this page after action executes , we can save the message with the key and display on jsp page with <html:messges/> tag .

Does that help ?


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
Kumar Sushil
Greenhorn

Joined: Jan 31, 2006
Posts: 29
Thanks for reply.
Actually I want use <bean:message> and as you are aware that for using <html:message> we required to write code in action classes also, that is not with <bean:message>.
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

Where are you creating this bean , loadInvestmentForm ?
Set this bean in request attribute and then use
runtime expression or JSTL tags like <jsp:useBean > or {loadInvestmentForm.code} in arg0=" " ..

Try this,
Kumar Sushil
Greenhorn

Joined: Jan 31, 2006
Posts: 29
When I try outside arg0 <bean:write> tag, it is working fine. I think in <bean:message> with args some problem. We can pass only hard code value or we required with run time expression. With JSTL also. nothing happend
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: getting error with bean:message tag