This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes ApplicationResources.properties, and the browser is rendering my <br> tags Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "ApplicationResources.properties, and the browser is rendering my <br> tags" Watch "ApplicationResources.properties, and the browser is rendering my <br> tags" New topic
Author

ApplicationResources.properties, and the browser is rendering my <br> tags

Nathan England
Greenhorn

Joined: Jul 13, 2009
Posts: 20
Hey,

I'm running into a confusing issue. I have a Struts 1.1 application.

I cannot seem to get line breaks to appear on the page after putting them into my ApplicationResources.properties.

For example, I am using ActionMessages to display the dynamic messages on the page. Here is a property that is getting read:


code from my JSP:


Instead of the page rendering:

Search yielded no results.
Please CONTINUE.


it is rendering:

Search yielded no results.<br>Please CONTINUE.


Note, no line return, and the page is actually showing the <br> tag, and not recognizing it as HTML.

So, now my text values in ApplicationResources.properties are very ugly, and all strung out in one huge line with no line breaks. I'm not sure what I might be doing wrong.

Any ideas on what I might try? Any workarounds?

-Nathan
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

The "workaround" is to read the tag docs and use the "filter" attribute.

http://struts.apache.org/1.1/userGuide/struts-bean.html#write
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ApplicationResources.properties, and the browser is rendering my <br> tags
 
Similar Threads
Spring JDBC Netbeans
html:messages not working, but request attribute is present
html in bean message
ActionMessage not iterating
Handling Messages (v1.2.9)