wrong HTML format in servlet output
3 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Thursday, June 21, 2001 09:06 AM

Hello


Ny servlet is writing a dynamic string as below:


out.println(frm + str + frmEnd);


frm and frmEnd are HTML formatted tags such as PRE and /PRE in <>.
If str includes " <" is interpreted as an HTML relavent thing.


How can I solve this problem.


Thanks in advance.

Re: wrong HTML format in servlet output

Posted By:   Alex_Chaffee  
Posted On:   Sunday, June 24, 2001 10:49 AM

You often have to convert < to < for it to display correctly. You should really read a basic HTML tutorial before doing web application development.


See What is the difference between URL encoding, URL r... for more information, and see http://www.purpletech.com/code/src/com/purpletech/util/Utils.java for a method that escapes entities for you.

Re: wrong HTML format in servlet output

Posted By:   Anonymous  
Posted On:   Thursday, June 21, 2001 10:21 PM

Yes, the "<", ">" (and maybe others) are special characters that are interpreted by the browser as tag delimiters.

If you want to use them, You should use their representation:


< = <

> = >


Regards.

Re: wrong HTML format in servlet output

Posted By:   Mittal_Bhiogade  
Posted On:   Thursday, June 21, 2001 08:11 PM

if you want to put something like
out.print("")

that u have to escape character ""
About | Sitemap | Contact