• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

less than changes to < automatically?

 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I apologize, this may not be the place for this question, but I am in the process of doing a struts tutorial and thought it might fit here. Basically, I am formatting a string to be used in a bean that my jsp page will <bean:write../> with. In my action page, i have the code below. The page loads and runs fine, I thought the <br> would cause a new line in the html.



However I get the following in the html:

Hello Mr. YOUR LAST NAME at:
1234 Near Ave<br>New Town, US<br>12345

Looking at the html source I get:
Hello Mr. YOUR LAST NAME at: <br>
1234 Near Ave&_lt;br&_gt;New Town, US&_lt;br&_gt;12345

I know that browsers won't interpret the white space and I tried using \n and \r\n to see if I would get lucky, but I can't seem to find out the trick. I also tried xml's <![CDATA[<br>]]> to see how the browser would handle it.

Is there something going on internally that is changing the < to &_lt; and > to &_gt;?

I am using NetBeansIDE 5.5.1 with jdk 1.5.0_11.

EDIT: The underscores in the &_gt; are not really there, just there to show that I am not getting < in the code.

Thank you for the help,
Joe

[ June 22, 2007: Message edited by: Joe Shy ]
[ June 22, 2007: Message edited by: Joe Shy ]
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This problem can be solved by specifying filter="false" in your <bean:write> tag.
 
Joe Shy
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wow, thank you so much. I looked all over thinking it was something that simple. However, I didn't really think it was on the bean side. Works great.

Thanks again,
Cheers
Joe
 
Slime does not pay. Always keep your tiny ad dry.
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic