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.1"> 
<!-- HelpASCII.jspx
 - Copyright (c) 2012, 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.

Last update: 2012.

Table of Contents

 About This Book

 JSP (JavaServer Pages) Overview

 Tomcat 7 Installation on Windows Systems

 JSP Scripting Elements

 Java Servlet Introduction

 JSP Implicit Objects

 Syntax of JSP Pages and JSP Documents

 JSP Application Session

 Managing Cookies in JSP Pages

 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 HTML Page

 Static HTML Text in JSP Page in Standard Syntax

 Static HTML Text in JSP Page in XML Syntax

 Supporting Characters in Multiple Languages

 Performance of JSP Pages

 EL (Expression Language)

 Overview of JSTL (JSP Standard Tag Libraries)

 JSTL Core Library

 JSP Custom Tags

 JSP Java Tag Interface

 Custom Tag Attributes

 Multiple Tags Working Together

 File Upload Test Application

 Outdated Tutorials

 References

 PDF Printing Version