Page #486 (Review Questions)

 
[Page 1240 ( continued )]

Programming Exercises

Section 35.4 JSP Scripting Constructs

35.1 ( Factorial table in JSP ) Rewrite Exercise 34.1 using JSP.
35.2 ( Multiplication table in JSP ) Rewrite Exercise 34.2 using JSP.

Section 35.5 Predefined Variables

35.3* ( Obtaining parameters in JSP ) Rewrite the servlet in Listing 34.4, GetParameters.java, using JSP. Create an HTML form that is identical to student_registration_form.html in Listing 34.3 except that the action is replaced by /liangweb/Exercise35_3.jsp for obtaining parameter values.

Section 35.6 JSP Directives

35.4 ( Calculating tax in JSP ) Rewrite Exercise 34.4 using JSP. You need to import ComputeTax in the JSP. Create a new ComputeTax.java in package chapter35 and compile it into c:\jakarta-tomcat-5.5.9\webapps\liangweb\WEB-INF\classes\chapter35 .
35.5* ( Finding scores from text files ) Rewrite Exercise 34.6 using servlets.
35.6** ( Finding scores from database tables ) Rewrite Exercise 34.7 using servlets.

Section 35.7 Using JavaBeans in JSP

35.7** ( Changing the password ) Rewrite Exercise 34.8 using servlets.

Comprehensive

35.8* ( Storing cookies in JSP ) Rewrite Exercise 34.10 using JSP. Use response.addCookie(Cookie) to add a cookie.

[Page 1241]
35.9* ( Retrieving cookies in JSP ) Rewrite Exercise 34.11 using JSP. Use Cookie[] cookies = request.getCookies() to add all cookies.
35.10 ( Drawing images ) Rewrite Listing 34.12, ImageContent.java, using JSP.
35.11*** ( Syntax highlighting ) Rewrite Exercise 34.12 using JSP.
35.12** ( Opinion poll ) Rewrite Exercise 34.13 using JSP.
35.13*** ( Multiple-question opinion poll ) The Poll table in Exercise 34.13 contains only one question. Suppose the table contains multiple questions. Write a JSP that reads all the questions from the table and displays them in a form, as shown in Figure 35.11(a). When the user clicks the Submit button, another JSP page is invoked. This page updates the Yes or No counts for each question and displays the current Yes and No counts for each question in the Poll table, as shown in Figure 35.11(b). Note that the table may contain many questions. The three questions in the figure are just examples. Sort the questions in alphabetical order.
Figure 35.11. The form prompts the user to enter Yes or No for each question in (a), and the updated Yes or No counts are displayed in (b).

 


[Page 1242]
 


Introduction to Java Programming-Comprehensive Version
Introduction to Java Programming-Comprehensive Version (6th Edition)
ISBN: B000ONFLUM
EAN: N/A
Year: 2004
Pages: 503

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net