Anda di halaman 1dari 2

JSP :

-----
- Java Server Pages
- Extension of Java Servlets
- Simplified version of Java Servlets
- Combination of HTML program & JSP Scriptlets
or
JSP Program is a part of the HTML program.
- Save with Extension .jsp
JSP Engine :
------------
- Software tool available in Java Web Server, IDE (NetBeans,Weblogic,Web
Sphere)
- used to execute a jsp programs
Architechture of JSP :
----------------------
1. Client requests a jsp program available in Server
2. Server transfers that request into JSP engine
while the requested file extension is .jsp.
3. JSP Engine generates a equivalant Servlet Source code to
requested JSP program.
4. JSP Engine compiles a generated servlet source code and makes
a byte code.
5. JSP engine loads a servlet byte code into server memory and
perform the process and return servlet's response object
into client machine.
Client ----> Request JSP Page ----> Server ----> JSP Engine
---> Generate Servlet Source ---> Compile & Make Byte Code
---> Load ByteCode into Server Memory ---> Execute a ByteCode
<--- Return Response Object into Client
Structure of JSP Program :
-----------------------------------
<Html>
<body>
Html document body
<%
JSP Scriptlets;
..
..
%>
</body>
</Html>
Types of Directives in JSP :
---------------------------------------
* just like a HTML tags.
* each directive contains a collection of different types of attributes
1) page - used to specify the property information to jsp page
2) include - used to include predefined html/jsp program content into curren
t jsp.
3) taglib - used to specified user defined tag information.
Syntax for using Directive :
----------------------------
<%@ directivename attribute1=value attribute2=value .... %>
Example :
---------
<%@page language="java" import="java.sql.*,java.io.*" contentType="text/html" %>
Implicit Objects in JSP :
-------------------------
1.out :
--------
* built-in object in JSP
* instance of PrintWriter class
* represents Response Object OutputStream or Servlet Protocol OutputStre
am
* used to return the output from the server into client.
2. request
3. response
4. session
5. cookies

Anda mungkin juga menyukai