//ch01_01.jsp
<HTML>
<HEAD>
<TITLE>A JSP Example</TITLE>
</HEAD>
<BODY>
<H1>Using JSP</H1>
<% out.println("No worries."); %>
</BODY>
</HTML>
//ch01_02.html
<HTML>
<HEAD>
<TITLE>Reading Text Fields</TITLE>
</HEAD>
<BODY>
<H1>Reading Text Fields</H1>
<FORM ACTION="ch01_03.jsp" METHOD="POST">
Enter your name:
<INPUT TYPE="TEXT" NAME="text1">
<BR>
<INPUT TYPE="SUBMIT" value="Submit">
</FORM>
</BODY>
</HTML>
//ch01_03.jsp
<HTML>
<HEAD>
<TITLE>Reading Data From Text Fields</TITLE>
</HEAD>
<BODY>
<H1>Reading Data From Text Fields</H1>
Your name is
<% out.println(request.getParameter("text1")); %>
</BODY>
</HTML>
//ch01_07.jsp
<HTML>
<HEAD>
<TITLE>Using a Bean</TITLE>
</HEAD>
<BODY>
<H1>Using a Bean</H1>
<% beans.ch01_04 messenger = new beans.ch01_04(); %>
The bean says: <%= messenger.message() %>
</BODY>
</HTML>
//ch01_07.jsp
<HTML>
<HEAD>
<TITLE>Using Bean Properties</TITLE>
</HEAD>
<BODY>
<H1>Using Bean Properties</H1>
<jsp:useBean id="bean1" class="beans.ch01_06" />
The bean says: <jsp:getProperty name="bean1" property="message" />
<BR>
<jsp:setProperty name="bean1" property="message" value="No Problem." />
Now the beans says: <jsp:getProperty name="bean1" property="message" />
</BODY>
</HTML>
|