Important concepts on Java Server Pages (JSP)
Important concepts on Java Server Pages (JSP)
Java Server Page is a standard Java extension that is defined on top of the servlet Extensions. The goal of JSP is the simplified creation and management of dynamic Web pages. JSP's are secure, platform-independent, and best of all; make use of Java as a server-side scripting language.
JSP page is a text-based document that contains two types of text: static template data, which can be expressed in any text-based format such as HTML, SVG, WML, and XML, and JSP elements, which construct dynamic content.
JSP TAGS:
JSP technology is extensible through the development of custom actions, or tags, which are encapsulated in tag libraries
Custom JSP tag is a tag you defined. You define how a tag, its attributes and its body are interpreted, and then group your tags into collections called tag libraries that can be used in any number of JSP files. To use custom JSP tags, you need to define three separate components:
1. the tag handler class that defines the tag's behavior
2. the tag library descriptor file that maps the XML element names to the tag implementations
3. the JSP file that uses the tag library
1. Directive tags:
Page directive: simple one for import stmts. Etc.
Include directive: to include specified file in jsp page.
Taglib directive: used to create custom tags.
2. Scriplet tags:
Scriplet tag: to specify java code with in jsp page.
Expression tag: to evaluate an expression.
Declaration tag: to declare variables. Etc.
3. Action tags:
forward action: forward from one jsp page to another jsp
Page similar to "request dispatcher class in servlets"
Include action: very much similar to include directive
except the imp. Difference. It's for dynamic content where
as that is for static content.
Use bean action: working with beans using jsp page.
Implicit Objects:
Certain objects that is available for the use in JSP documents without being declared first. These objects are parsed by the JSP engine and inserted into the generated servlet. The implicit objects re listed below:
Request : same as HttpServletRequest object.
Response : same as HttpServletResponse object.
Page : same as java.lang.Object.
Config : same as ServletConfig.
Context : same as servletContext.
Out : same as printWriter object in servlets.
Session: Http: same as Session obj.
Page context: like page Context.
Exception : java.lang.exception.
Difference between forward and sendRedirect?
When you invoke a forward request, the request is sent to another resource on the server, without the client being informed that a different resource is going to process the request. This process occurs completely with in the web container. When a sendRedirtect method is invoked, it causes the web container to return to the browser indicating that a new URL should be requested. Because the browser issues a completely new request any object that are stored as request attributes before the redirect occurs will be lost. This extra round trip a redirect is slower than forward.
Pdf To Html Converter Convert Pdf Files To Html Web Page Small Business Internet Advertising Tip Make Money Fast And Easy Using The Internet How To Select The Perfect Internet Marketer? Download Movies Not Just in Parts…But in Full Length Quality! Protect Your Wireless And Wired Network With Tech Support sim free mobile phones– buy your handset with any network Get Dish Network In Free-to-guest Facilities PSD to HTML Conversion: What is the Importance? Internet Ya No Es Un Juego De Nios The More Efficient, Successful Way for Network Marketing Prospecting Internet Dating Do'S And Don'Ts HTC Desire Z : Fun Of Social Networking