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 ".
<%@page pageEncoding="GBK" %>
<%@page 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.
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.