Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Struts and the fly likes bean:message passing dynamic arguments Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "bean:message passing dynamic arguments" Watch "bean:message passing dynamic arguments" New topic

bean:message passing dynamic arguments

Venkat Babu
Ranch Hand

Joined: Jan 12, 2007
Posts: 47

In my i have:

label.inst=From {0} to {1}

and in jsp
<bean:message key="label.inst" arg0="2007" arg1="2009"/>

This works fine.

But if I pass dynamic values in the arguments I am having problems

I tried
String s1 = "2007";
String s2 = "2011":
<bean:message key="label.inst" arg0="<%=s1%>" arg1="<%=s2%>"/>

Any help will be great.

Venkat Babu
Ranch Hand

Joined: Jan 12, 2007
Posts: 47
Never mind. The jsp was complaining "Missing quotes for attribute value". But when I accessed the page it worked. I think there is some problem with my IDE.

I agree. Here's the link:
subject: bean:message passing dynamic arguments
It's not a secret anymore!