This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes JSP and the fly likes bean:message key and bean:write not working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » JSP
Bookmark "bean:message key and bean:write not working" Watch "bean:message key and bean:write not working" New topic

bean:message key and bean:write not working

erika chua

Joined: Oct 03, 2011
Posts: 2
I have this string in my .java file.

String str = "<a href =\"" + url + "\"><bean:message key=\"\"/></a>";

that turns out like this below, which is (i suppose) correct.

<a href = ""><bean:message key=""/></a>

and it follows this

request.setAttribute("header", str);

In my .jsp file

<bean:write name="header" scope="request" filter="false"/>

In my properties file = Search

I dont understand why this does not work. but of course if i change <bean:message key=""/> to a text like ABC, it works perfectly fine.
I also tried in other .jsp files, it works fine too
olivier dutranoit
Ranch Hand

Joined: Aug 20, 2011
Posts: 81


You cannot write in your servlet

and next, using this string in your jsp, and expecting the syntax to be evaluated.

<bean:message key=\"\"/>
can only be evaluated inside a jsp. Not trough your servlet.
Have you checked out Aspose?
subject: bean:message key and bean:write not working
It's not a secret anymore!