June 2005
Beginner to intermediate
336 pages
6h 29m
English
Take a look at the chat room in Figure 5.1; you can see various HTML controls there, namely the text field where the users type their name, the text area where they type their comments, and the Submit button. How do those controls send data to your JSP page?
HTML controls must be enclosed in HTML forms, which you create with the <FORM> element. For example, if you want to add a text field to a web page using the <INPUT TYPE="TEXT"> element, that element must be inside a form. Here's what that looks like in an HTML example, ch05_04.html:
<HTML>
<HEAD>
<TITLE>Enter your name</TITLE>
</HEAD>
<BODY>
<H1>Enter your name</H1>
<FORM NAME="form1" ACTION="ch05_05.jsp" METHOD="POST">
<INPUT TYPE="TEXT" NAME="text"> ...Read now
Unlock full access