Java Reference
In-Depth Information
<body>
<form action="test.do" method="post">What's your first name? <br />
<input type="text" name="name" /> <br />
<input type="submit" value="Submit" /></form>
</body>
</html>
Figure 4-7. The index.jsp page providing user input
Now you need to create the JSP page that displays the value submitted by the user.
The code in Listing 4-14 uses the JavaServer Pages Standard Tag Library to display
the name that the user entered in the previous page (Figure 4-8).
Listing 4-14. The test.jsp page
<?xml version="1.0" encoding="ISO-8859-1" ?>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ page isELIgnored="false"%>
<%@taglib prefix="c" uri=" http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns=" http://www.w3.org/1999/xhtml">
<head>
 
Search WWH ::




Custom Search