Java Reference
In-Depth Information
We are then given the option of creating a JSP file using standard syntax (default), a
JSP using XML syntax, or a JSP fragment. In our experience, most JSPs are developed
using standard syntax, and NetBeans provides us with a lot more help if we choose
this syntax. An alternate syntax for JSP files is the XML syntax. This syntax is less
popular than standard syntax and, other than code completion, NetBeans doesn't
offer a lot of help when working with it. For this reason we chose to use standard
syntax for our pages.
NetBeans generated JSPs when developing Java Server Pages applications
via the visual web development functionality use XML syntax. Visual
web page markup is for the most part automatically generated, leaving
us to manually code little or no markup in the generated JSPs. Visual web
development will be covered in detail in Chapter 6.
We are also given the option of creating a JSP segment. JSP segments (or fragments)
are pages containing common markup that is contained in many pages in an
application. JSP fragments typically contain navigation menus, header information,
and so on. They can then be included dynamically into JSPs in the application.
The advantage of JSP fragments is that this common markup can be maintained
separately instead of having to update several JSPs in the application. We will cover
JSP fragments later in this chapter.
After entering all appropriate data in the New JSP File pop-up window, NetBeans
generates a JSP file we can use as a starting point. We need to modify this file to
obtain the data that was entered in the previous page.
<%--
Document : output
Created on : Jan 20, 2008, 1:27:46 PM
Author : heffel
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=UTF-8">
<title>Thank You!</title>
</head>
<body>
<h2>Thanks for taking our survey</h2>
<p>
 
Search WWH ::




Custom Search