Tuesday, April 12, 2011

Quick Recap: Chapters 31 to 37

Let us quickly go through what we learnt in the previous few chapters about the JSP Technology.

Introduction to JSPs

• JSPs are an integral part of any J2EE Application and are used extensively
• CGI, Perl and Active Server Pages (ASP) are all predecessors of the JSP Technology
• A JSP page gets converted/translated into a Servlet before it is executed
• You can have the following in a JSP Page
     o HTML Code
     o Java Code
     o XML Code
     o JSP Scriptlets

JSP Tags:

• JSP Tags begin with a “<” symbol and end with a “>” symbol
• There are many directives that can be used in a JSP Page
• The include directive is a placeholder that lets you include the text in another file
• The page directive gives directions to the servlet engine about the general setup of the page
• The scriptlet is a way to include Java code directly in a JSP page
• JSP Tags can be used in two ways. One is the regular JSP Tag construct and the other is the XML Equivalent.

The Page Directive:

• The Page Directive is one of the important components of any JSP Page. It can help us define page specific properties like Buffer size or location of an error page etc
• In JSP, you do not have to use the page directive for the default import list of java.lang.*, javax.servlet.*, javax.servlet.jsp.*, and javax.servlet.http.*. These are automatically available to you
• The page directive can be used to define an error page to which the control will be re-directed in case there is an issue with the current page
• The page directive also defines if the current page is an error page that would be invoked by any other JSP page

JSP Lifecycle:

• Just like Servlets, JSPs too have a life cycle
• The following are the life cycle stages of a JSP Page
     o Page translation
     o Page compilation
     o Load class
     o Create instance
     o Call jspinit
     o Call _jspService
     o Call jspDestroy

JSP Implicit Objects:

In any JSP Page, there are a bunch of implicit objects that are available for the programmer to use. It contains a variety of information that can be used to display stuff on the page. The following Implicit Objects are available for the programmer inside the JSP Page
• request
• response
• out
• session
• config
• application
• page
• pageContext
• exception

Key Terms Learnt in the previous Chapters:
• servlet
• directive
• expression
• scriptlet
• implicit object
• JSP container
• JSP page lifecycle
• tag library
• Web application

Previous Chapter: Chapter 37 - JSP Scriptlets

Next Chapter: Self Test - Chapters 31 to 37

No comments:

Post a Comment

© 2013 by www.inheritingjava.blogspot.com. All rights reserved. No part of this blog or its contents may be reproduced or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without prior written permission of the Author.


Google+ Followers