• Post Reply Bookmark Topic Watch Topic
  • New Topic

<xmp> for jsp special characters  RSS feed

 
vivek dhiman
Ranch Hand
Posts: 153
Netbeans IDE Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I have some XML tags in jsp like.

. Now on the basic of request param i want these tags should render with value < or > on the basis of what is inside tags. I applied the below code but didn't work. Any Idea.


Any Idea
 
Devaka Cooray
Marshal
Posts: 5325
575
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't understand what you were trying to do with the second code. What is testval? What is <xmp>? Is that a part of the problem?

Looking at the first code, have you tried something like this?:

As another solution, you can also escape '<' and '>' characters to something like &lt; and &gt; to make it hassle-free.
 
vivek dhiman
Ranch Hand
Posts: 153
Netbeans IDE Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry for less information, I have xml code inside jsp & when jsp renders then suppose


Its should render is customdebug mode like

every < should convert to ampersandlt and > convert to ampersandgt . Any Idea how can i achieve it.

Thanks
 
vivek dhiman
Ranch Hand
Posts: 153
Netbeans IDE Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here it worked :


Thanks
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!