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 ]