Introduction To Ava Erver Ages Technology
Introduction To Ava Erver Ages Technology
http://www.techinterviews.com /?p=92
What is JSP?
Java based technology that simplifies the developing of dynamic web sites JSP pages are HTML pages with embedded code that allows to access data from Java code running on the server JSP provides separation of HTML presentation logic from the application logic.
JSP Flow
JSP Technology
JSP technology provides a way to combine the worlds of HTML and Java servlet programming. JSP specs are built on the Java Servlet API. JSP supports two different styles for adding dynamic content to web pages:
JSP pages can embed actual programming code (typically Java) JSP supports a set of HTML-like tags that interact with Java objects on the server (without the need for raw Java code to appear in the page).
2.
SimpleJSP.jsp
How it is work?
Client request for a page ending with ".jsp. Web Server fires up the JSP engine. The JSP engine checks to see if the JSP file is new or changed. The JSP engine takes the page and converts it into a Java servlet (by JSP parser) The JSP engine compiles the servlet (by standard Java compiler). Servlet Engine executes the new Java servlet using the standard API. Servlets output is transferred by Web Server as a http response.
For Example:
<%= fact(12) %> <%= (hours <12) ? AM : PM %> <%= Math.pow(radius, 2) %>
Scriptlets:
<% scriptlet %> or XML variant: <jsp:scriptlet> scriptlet </jsp:scriptlet>
Declarations:
<%! declaration (s) %> or XML variant: <jsp:declaration> declaration(s) </jsp: declaration>
For Example
JSP benefits
Java-based technology Vendor-neutral Full access to underlying Java platform Performance Reusable components (JavaBeans) Separating presentation and implementation
Resources
Sun JSP 1.1 Specs and description Server Side Java Resource Site IBM education courses JSP resource index JSP insider
The end
Scriptlet Example