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.
Actually, i am sending content which is in HTML format, from Webpage to applet code. The applet code contains JEditorPane code to display the html content as such. If i replace "<" to & lt ;(without space) then the tags too get converted.
While returning back the content, it is viewed with tags in the JEditorpane.
Could anyone please explain me why"<" symbol is appearing in JEditorPane when the contenttype is text/html?
The java applet program contains the above variable.If i replace the symbol then all the symbols gets replaced.
Am i clear?
Joined: Feb 26, 2006
Hi Bhuvana, HTML is very loosely typed language. I understand what you are facing and what i meant is the you should be looking at replacing those < > signs in where you are getting them from and not after reading them.
If it is possible well and fine, else there are options 1. You write a full fledged HTML parser that finds out the right tags (in that process you will go mad) 2. find out some patterns that can identify the < > signs in your text like in here you can replace " > " instead of ">"
Joined: Sep 07, 2006
Thanks for your reply.
Could you please explain me about why less than symbol not appears in JEditorPane?