16-07-2011, 03:40 PM
SUBMITTED BY: HARSH PAREEK
[attachment=14502]
What is JSP?
Mostly HTML page, with extension .jsp
Include JSP tags to enable dynamic content creation
Translation: JSP → Servlet class
Compiled at Request time
(first request, a little slow)
Execution: Request → JSP Servlet's service method
Why JSPs?
Goal: Create dynamic web content (HTML, XML, ...) for a Web Application
Goal: Make it easier/cleaner to mix static HTML parts with dynamic Java servlet code
JSP specification ver. 2.0
Java Servlet specification ver. 2.4
Advantages
Code -- Computation
HTML -- Presentation
Separation of Roles
Developers
Content Authors/Graphic Designers/Web Masters
Supposed to be cheaper... but not really...
Action Elements
Standard Actions
Custom Actions
Standard Actions
<jsp:getProperty>
Gets a property value from a JavaBeans component and adds it to the response
<jspetProperty>
Set a JavaBeans property value
<jsp:include>
Includes the response from a servlet or JSP page during the request processing phase
<jsp:forward>
Forwards the processing of a request to servlet or JSP page
Custom Actions (Tag Libraries)
Can Define Your own!
Description
Define
Install
Declare
Use
[attachment=14502]
What is JSP?
Mostly HTML page, with extension .jsp
Include JSP tags to enable dynamic content creation
Translation: JSP → Servlet class
Compiled at Request time
(first request, a little slow)
Execution: Request → JSP Servlet's service method
Why JSPs?
Goal: Create dynamic web content (HTML, XML, ...) for a Web Application
Goal: Make it easier/cleaner to mix static HTML parts with dynamic Java servlet code
JSP specification ver. 2.0
Java Servlet specification ver. 2.4
Advantages
Code -- Computation
HTML -- Presentation
Separation of Roles
Developers
Content Authors/Graphic Designers/Web Masters
Supposed to be cheaper... but not really...
Action Elements
Standard Actions
Custom Actions
Standard Actions
<jsp:getProperty>
Gets a property value from a JavaBeans component and adds it to the response
<jspetProperty>
Set a JavaBeans property value
<jsp:include>
Includes the response from a servlet or JSP page during the request processing phase
<jsp:forward>
Forwards the processing of a request to servlet or JSP page
Custom Actions (Tag Libraries)
Can Define Your own!
Description
Define
Install
Declare
Use