Home Jsp The pageEncoding Attribute of page Directive In JSP



The pageEncoding Attribute of page Directive In JSP
Posted on: February 7, 2008 at 12:00 AM
This section provides the best illustration about the pageEncoding attribute of the page directive in JSP.

The pageEncoding Attribute of page Directive In JSP

     

This section provides the best illustration about the pageEncoding attribute of the page directive in JSP. This attribute specifies the language that the page uses when the page is sent to the browser. This attribute works like the meta tag of the HTML markup language.

Here, in this section you will see the value of the attribute of the page directive is "GBK" in the PageEncoding.jsp page and the value of the attribute is "ISO-8859-1" in the PageEncoding1.jsp. This is the simple difference between the page PageEncoding.jsp and the page PageEncoding1.jsp. But the output is changed from one-another as you can see by differentiating the Chinese character in both output browser.

Here is the code of the PageEncoding.jsp page:

<%@page pageEncoding="GBK" %>
      <html>
<head><title>Example of pageEncoding attribute of page directive in JSP.</title></head>
      <body>
<table border="1" cellspacing="0" cellpadding="0" bgcolor="ffff00">
			<tr>
<td><strong>æ±This is the example of pageEncoding 
attribute of page directive.</strong></td>
			</tr>
		</table>
	</body>
</html>

Output for the PageEncoding.jsp page:

Here is the code of the PageEncoding1.jsp page:

<%@page pageEncoding="ISO-8859-1" %>
       <html><html>
<head><title>Example of pageEncoding attribute of page directive in JSP.</title></head>
       <body>
  <table border="1" cellspacing="0" cellpadding="0" bgcolor="ffff00">
    <tr>
     <td><strong>æ±This is the example of pageEncoding 
attribute of page directive.</strong></td>
    </tr>
  </table>
</body>
</html>

Output for the PageEncoding1.jsp page:

Download the PageEncoding.jsp page.

Download the PageEncoding1.jsp page.

Related Tags for The pageEncoding Attribute of page Directive In JSP:
htmlcjspbrowserencodinglanguageiopagemarkupvaluetagattributethiscodingrowlikejsifrowsiemetaworktowseiso-8859-1cilanwseildirectiveisosectiong1liusepebrowseinmlmnttrjesspecdiragemewhensrectspsoeedirectatkmarkhtmisirhallivgbandarcodvausesttssrithbk.jsaluhatndono


More Tutorials from this section

Ask Questions?    Discuss: The pageEncoding Attribute of page Directive In JSP   View All Comments

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 

Ask Questions?

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.