Page #485 (Chapter Summary)

 
[Page 1239 ( continued )]

Review Questions

Sections 35.1 “35.3

35.1 What is the file name extension of a JavaServer page? How is a JSP page processed ?
35.2 Where should a JSP file be placed for it to run from Tomcat?
35.3 You can display an HTML file (e.g., c:\test.html ) by typing the complete file name in the Address field of Internet Explorer. Why can't you display a JSP file by simply typing the file name?

Section 35.4 JSP Scripting Constructs

35.4 What are a JSP expression, a JSP scriptlet, and a JSP declaration? How do you write these constructs in JSP?
35.5 Find three syntax errors in the following JSP code:
   <%! int   k   %>     <% for   (   int   j =   1   ; j <=   9   ; j++)   %>     <%=   j;   %> <br />   

35.6 In the following JSP, which variables are instance variables and which are local variables when it is translated in the servlet?
   <%! int   k;   %>     <%! int   i;   %>     <% for   (   int   j =   1   ; j <=   9   ; j++) k +=   1   ;   %>     <%=   k   ><br /> <%=   i   ><br /> <%=   getTime()   ><br/>     <% private long   getTime() {   long   time = System.currentTimeMillis();   return   time;    }   %>   


[Page 1240]

Section 35.5 Predefined Variables

35.7 Describe the predefined variables in JSP.
35.8 What is wrong if the JSP scriptlet <% in line 7 in ComputeLoan.jsp (Listing 35.3) is replaced by JSP declaration <%! ?
35.9 Can you use predefined variables (e.g., request , response , out ) in JSP declarations?

Section 35.6 JSP Directives

35.10 Describe the JSP directives and attributes for the page directive.
35.11 If a class does not have a package statement, can you import it?
35.12 If you use a custom class from a JSP, where should the class be placed?

Section 35.7 Using JavaBeans in JSP

35.13 You can create an object in a JSP scriptlet. What is the difference between an object created using the new operator and a bean created using the <jsp:useBean ... > tag?
35.14 What is the scope attribute for? Describe four scope attributes.
35.15 Describe how a <jsp:useBean ... > statement is processed by the JSP engine.

Sections 35.8 “35.10

35.16 How do you associate bean properties with input parameters?
35.17 How do you write a statement to forward requests to another JSP page?
 


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