Page #484 (35.11. Case Study: Browsing Database Tables)

 
[Page 1238 ( continued )]

Chapter Summary

  • A JavaServer page is like a regular HTML page with special tags, known as JSP tags , which enable the Web server to generate dynamic content. You can create a Web page with static HTML and enclose the code for generating dynamic content in the JSP tags.

  • A JSP page must be stored in a file with a .jsp extension. The Web server translates the .jsp file into a Java servlet, compiles the servlet, and executes it. The result of the execution is sent to the browser for display.


    [Page 1239]
  • A JSP page is translated into a servlet when the page is requested for the first time. It is not retranslated if the page is not modified. To ensure that the first-time real user does not get a delay, JSP developers may test the page after it is installed.

  • In order to display a JSP page, the page must be placed in a designated directory (e.g., c:\jakarta-tomcat-5.5.9\webapps\liangweb ) and must be accessed from a JSP-enabled Web server with an appropriate URL (e.g., http://localhost:8080/liangweb/CurrentTime.jsp ).

  • There are three main types of JSP constructs: scripting constructs, directives, and actions. Scripting elements enable you to specify Java code that will become part of the resultant servlet. Directives enable you to control the overall structure of the resultant servlet. Actions enable you to control the behaviors of the JSP engine.

  • There are three types of scripting constructs that can be used to insert Java code into the resultant servlet: expressions, scriptlets, and declarations.

  • The scope attribute (application, session, page, and request) specifies the scope of a JavaBeans object. Application specifies that the object be bound to the application. Session specifies that the object be bound to the client's session. Page is the default scope, which specifies that the object be bound to the page. Request specifies that the object be bound to the client's request.

  • Web applications developed using JSP generally consist of many pages linked together. JSP provides a forwarding tag in the following syntax that can be used to forward a page to another page: <jsp:forward page="destination"/> .

 


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