JSP Tutorials - Herong's Tutorial Examples - v5.11, by Herong Yang
Handling ASCII Characters in JSP Pages
This section provides a tutorial example to show that ACSII characters entered in JSP pages will show up on browsers without any trouble. All technologies used different steps support ASCII by default.
As I mentioned earlier, ASCII characters can travel from JSP files to browsers easily without any trouble. Here is a simple JSP file with ASCII characters only:
<?xml version="1.0"?> <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.3"> <!-- HelpASCII.jspx - Copyright (c) 2006 HerongYang.com. All Rights Reserved. --> <jsp:directive.page contentType="text/html"/> <html><body> <b>Help</b><br/> <p>This is a very simple help page...</p> </body></html> </jsp:root>
If you view this page with a browser, you will get two lines of characters:
Help This is a very simple help page...
The output text is exactly what I entered into the JSP file.
Table of Contents
JSP (JavaServer Pages) Overview
Tomcat Installation on Windows Systems
Syntax of JSP Pages and JSP Documents
JavaBean Objects and "useBean" Action Elements
Managing HTTP Response Header Lines
►Non-ASCII Characters Support in JSP Pages
Characters Traveling from JSP Files to Browser Screens
►Handling ASCII Characters in JSP Pages
Presenting Non ASCII Characters in HTML Documents
Entering Non ASCII Characters in JSP Pages
Java Strings as non-Unicode Encoded Byte Sequences
Java Strings as Unicode Encoded Byte Sequences
Entering Non-ASCII Characters as Static Text
Static HTML Text in JSP Page in Standard Syntax
Static HTML Text in JSP Page in XML Syntax
Supporting Characters in Multiple Languages
Overview of JSTL (JSP Standard Tag Libraries)
Multiple Tags Working Together
Using Tomcat on CentOS Systems
Connecting to SQL Server from Servlet