In this section, we will discuss about how to set "pageEncoding" attribute & it's uses with example.The JSP page encoding is the character encoding in which the file is encoded. For JSP pages in standard syntax, the page encoding is determined from the following sources:
If none of these is provided, ISO-8859-1 is used as the default page encoding.
Example: In this example, we will create two JSP pages with the same content except their "pageEncoding" attribute. First JSP page sets attribute "GBK" while second JSP page sets default value i.e." ISO-8859-1 ".
<[email protected] pageEncoding="GBK" %>
<[email protected] pageEncoding="ISO-8859-1" %>
NOTE: In this example, see the "Š▒" string . The "GBK" pageEncoding display a different thing as compared to "ISO-8859-1" encoding. The "ISO-8859-1" encoding is clearly visible.
Posted on: June 15, 2010 If you enjoyed this post then why not add us on Google+? Add us to your Circles