aspose file tools*
The moose likes Struts and the fly likes struts 1 supports in using <bean:message> multiple times Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts 1 supports in using <bean:message> multiple times" Watch "struts 1 supports in using <bean:message> multiple times" New topic
Author

struts 1 supports in using <bean:message> multiple times

damodar kumar
Ranch Hand

Joined: May 19, 2008
Posts: 77

Hi

i have a requirement to show multiple messages in a jsp , can i use <bean:message>, will this support to get multiple messages in a jsp.

Im using sturts 1 .

Please help me


<a href="http://stackoverflow.com/users/668970/user668970" rel="nofollow">
<img src="http://stackoverflow.com/users/flair/668970.png" >
</a>
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Can you re-describe what you're trying to do?
Omar Al Kababji
Ranch Hand

Joined: Jan 13, 2009
Posts: 357
do you mean by message, that you have to print some dynamic text on the page?

if yes you could add the messages to an ArrayList in you controller and pass it to the JSP and in the JSP use a c:forEach tag to iterate over the list and print the "messages"


Omar Al Kababji - Electrical & Computer Engineer
[SCJP - 90% - Story] [SCWCD - 94% - Story] [SCBCD - 80% - Story] | My Blog
Omar Al Kababji
Ranch Hand

Joined: Jan 13, 2009
Posts: 357
However if your application in internationalized (multiple languages) you can put the "keys" of your messages in the ArrayList, and use the <bean:message> to print the internationalized message.
damodar kumar
Ranch Hand

Joined: May 19, 2008
Posts: 77

yes im implementing internationalization, and also im using struts version 1.1 did struts version supports using of <bean: message> multiple times in a jsp.

for example :

lets think

there are 5 labels in my jsp which needs to be internationalization so that i want use <bean: message> five times in my jsp

did struts 1.1 supports using of <bean: message> 5 times in my jsp are there i any other alternate present

please suggest me.

Thanks & Regards,

Damodar.
Omar Al Kababji
Ranch Hand

Joined: Jan 13, 2009
Posts: 357
if it accepts <bean:message> once it will accept it 100000 times

just try it and everything will be fine, but check out how to use it first
damodar kumar
Ranch Hand

Joined: May 19, 2008
Posts: 77

Omar Al Kababji


I did a RND , but

Struts 1.1 doesnot support to have multiple beam message tags in a singal jsp file ,

Please any body provide me any other approach to show the lables of the jsp depending on locle.

Thanks & Regards,

Damodar.
Omar Al Kababji
Ranch Hand

Joined: Jan 13, 2009
Posts: 357
impossible, you can use it as much as you want:



two things, you didn't try it, or I don't understand what you mean by multiple messages on a JSP.
damodar kumar
Ranch Hand

Joined: May 19, 2008
Posts: 77

Hi Omar Al Kababji ,

Thanks for your support and suggestions.

The problem is not with struts it the problem with weblogic 8.1 , it is not compiling the jsp having two bean:message tags,

the problem was solved , i moved to weblogic 9.1 and websphere 6.0.

Thanks a lot abd your support for all the people who replayed me.

Dam
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

That doesn't make any sense--there's nothing in WL 8.1 that "doesn't support" mutliple <bean:message> tags; we had multiple S1 apps, all with many tags, running on 8.1.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: struts 1 supports in using <bean:message> multiple times