This post originated from an RSS feed registered with Java Buzz
by Javin Paul.
Original Post: How to escape HTML Special characters in JSP and Java
Feed Title: Java67
Feed URL: http://www.java67.com/feeds/posts/default?alt=rss
Feed Description: Java and technology tutorials, tips, questions for all programmers.
Escaping HTML special characters in JSP or Java is common task for Java programmers. There are many ways to escape HTML meta characters in Java, some of them we have already seen in last article escaping
XML meta characters in Java. For
those who are not familiar with HTML special characters, there are five e.g. <
, >, &, ' and '' and if you want to print them literally just like
here, Than you need to escape those character so < becomes < , >
becomes > and so on. Of course you can write your own custom tag or
method for converting HTML special characters to entity format
which browser understand but you don't need to do this because there are more easy
and standard way to escape HTML special
characters in JSP and Java. In this JSP and Java tutorial we will learn
about HTML special characters and explore some techniques to escape them in JSP
pages and Java code. By the way this is also a popular
JSP Interview question mostly asked to 2 years experience programmers.