Creating Static Content

You create static content in a JSP page by simply writing it as if you were creating a page that consists only of that content. Static content can be expressed in any text-based format such as HTML, WML, and XML. The default format is HTML. If you want to use a format other than HTML you include a page directive with the contentType attribute set to the format type at the beginning of your JSP page. For example, if you want a page to contain plain text, you need to include the following directive:

<%@ page contentType="text/plain"%> 

A registry of content type names is kept by IANA at:

ftp://ftp.isi.edu/in-notes/iana/assignments/media-types 


From the J2EE Tutorial section on JavaServer Pages Technology by Stephanie Bodoff.

Maintained by John Loomis, last updated 31 March 2001