This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Struts and the fly likes Access resources from jsp without using Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Access resources from jsp without using "bean:message" tag" Watch "Access resources from jsp without using "bean:message" tag" New topic
Author

Access resources from jsp without using "bean:message" tag

intenter
Greenhorn

Joined: Aug 31, 2004
Posts: 7
Hi.
I need access to message resources from jsp page not using <bean:message key=some.key/>.

So what is the name of bean, whitch stores messages? I found out, that it's name stores in Action.MESSAGES_KEY property of Action class. But i cannot download sources of struts.

Or maybe someone can tell me how to do this:<some_tag value="HERE MUST BE MESSAGE SOME.KEY"/> using JSTL or EL. Not using scriptlets

Thanks.
sreenath reddy
Ranch Hand

Joined: Sep 21, 2003
Posts: 415
Hello sir


Tell me what u need exactly ....because u dont need <bean:message and u dont need scriptlets .........then how will u achieve this with out writing a custom tag even that will do the same as <bean:message
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

I don't know your motivations for wanting this and I have a funny feeling I'd disagree with them if I knew what they were. Anyway, this might do the trick:
<bean efine name="org.apache.struts.action.MESSAGE" id="resources" scope="session"/>


A good workman is known by his tools.
intenter
Greenhorn

Joined: Aug 31, 2004
Posts: 7
Originally posted by sreenath reddy:
Tell me what u need exactly ....


I need to do: <input type="submit" value="LOCALIZED MESSAGE"/>

And also <tiles ut name="value" value="LOCALIZED MESSAGE"/>
sreenath reddy
Ranch Hand

Joined: Sep 21, 2003
Posts: 415
Hi Alexander

Seems u r not aware of html:submit tag .......... the first one u can do by using

<htnl:submit><bean:message key/></html:submit>

and coming to ur second requirement why do u need the path of a resource to come from resource bundle ..........because this will be in xml that too its very tough to get the path from bundle ...tell me excatly the scenarion where u need this type
intenter
Greenhorn

Joined: Aug 31, 2004
Posts: 7


Layout source (take a look at title):

Of cource, i could insert <bean:message> directly into layout page, but in this case, this layout will not be "template" any more.

[ September 01, 2004: Message edited by: Alexander Chasovsky ]
[ September 01, 2004: Message edited by: Alexander Chasovsky ]
 
 
subject: Access resources from jsp without using "bean:message" tag