KEMBAR78
J2EE and Servlet | PPT
INDUSTRIAL TRAINING 
Overview Of J2EE & SERVLET
INDUSTRIAL TRAINING 
Past History 
 Initially two tier architecture (client 
server applications) 
 Client is responsible for data access 
applying business logic and 
presentation of data 
 Only service provided by Server was 
that of database server.
INDUSTRIAL TRAINING Two Tier Application 
Architecture 
Client Server
INDUSTRIAL TRAINING Two Tier Application 
Architecture 
 Drawbacks 
- Easy to deploy but difficult to enchance 
or upgrade. 
- It makes reuse of business and 
presentation logic difficult 
- Not scalable and not suited for internet
INDUSTRIAL TRAINING Java 2 Platform Enterprise 
Edition(J2EE) 
J2EE is an architecture for implementing 
enterprise class applications using Java 
and Internet Technology 
- Solves problems of two tier architecture
INDUSTRIAL TRAINING 
J2EE 
 To develop n tier application 
 It supports the development of a 
variety of application types 
 small client server systems 
 Systems running on Intranets 
 Systems on large scale internet e-commerce 
site
INDUSTRIAL TRAINING 
J2EE Features 
 Component based model 
 Container provided services 
 Highly Scaleable 
 Simplified Architecture 
 Flexible security model
INDUSTRIAL TRAINING 
Java: Foundation for J2EE 
 J2EE is an application of java 
 Write once and deploy the code into 
any platform
INDUSTRIAL TRAINING 
J2EE Components & Services 
 Primary technologies 
- Servlets 
- JavaServer Pages (JSP) 
- Enterprise JavaBeans (EJB) 
 Standard services & supporting technologies 
- Java database connectivity(JDBC) data access API 
- Remote Method Invocations (RMI) 
- Extensible Markup Languages(XML) 
- JavaIDL 
- JavaMail
INDUSTRIAL TRAINING 
J2EE Tiers 
 Client Presentation 
 HTML or Java applets deployed in Browser 
 XML documentations transmitted through 
HTTP 
 Java clients running in Client Java Virtual 
Machine (JVM) 
• Presentation Logic 
 Servlets or JavaServer Pages running in 
web server 
• Application Logic 
 Enterprise JavaBeans running in Server
INDUSTRIAL TRAINING 
J2EE Application Model 
 Browser is able to process HTML and 
applets pages. 
 It forwards requests to the web server, 
which has JSPs and Servlets 
 Servlets and JSPs may access EJB 
server. 
 Java Standalone runs on java client, 
which access EJB server using RMI.
INDUSTRIAL TRAINING 
J2EE Application Model
INDUSTRIAL TRAINING 
Overview of Servlets 
 Are container managed web components 
 Replace Common Gateway Interface(CGI) or 
Active Server Pages (ASP) 
 Generate dynamic response to requests from 
web based clients 
 Synchronize multiple concurrent client 
request 
 Serve as client proxies
INDUSTRIAL TRAINING 
Servlet Operation 
 Server is Java program that runs as 
separate thread inside servlet container. 
 Servlet container is part of web server 
 It interact with web client using 
response request paradigm
INDUSTRIAL TRAINING 
JavaServer Pages (JSP) 
 Text based documents describe how to 
process a request and create a 
response 
 Contains HTML or XML and other JSP 
elements defined by JSP specification. 
 Are Installed on web server 
 are web components that sits on top of 
java servlet mode.
INDUSTRIAL TRAINING 
JSP Advantages 
 Performance 
 Runtime characteristics of servlets 
 Automatic recompilation of modified pages 
 Server side processing 
 Programming 
 Emphasize use of reusable components 
 Write Once , Run Anywhere properties 
 Extensible through custom tag libraries 
 Provides front end access mechanism to 
EJBs
INDUSTRIAL TRAINING 
Parts of JSP Pages 
Directive 
<%@ pageimport=“java.util.”, MVCApp.Cart, MVCApp.CartItem” %> 
Declaration 
<%! Iterator it = null; CartItem ci = null; Vector cpi = null;%> 
Raw HTML 
<html><head><title>Shopping Cart</title></head></html> 
Action 
<jsp:usebean id =“Cart” scope = “session” class = “MVCApp.Cart”/> 
Scriplets 
% 
Cpi = cart.getCartItems ( ); 
it = cpi.iterator(); 
While (it.hasNext()){ci= (Cart Item)it.next(); 
%>
INDUSTRIAL TRAINING 
Parts of JSP Pages 
 Expression 
<td<% = ci.getTitle() %></td> 
<td align =“right”><%=ci.getQuantity()%></td> 
 Implicit Objects 
<% string action = request.getParameter(“action”) ; %>
INDUSTRIAL TRAINING 
Conclusion 
THANK------YOU

J2EE and Servlet

  • 1.
  • 2.
    INDUSTRIAL TRAINING PastHistory  Initially two tier architecture (client server applications)  Client is responsible for data access applying business logic and presentation of data  Only service provided by Server was that of database server.
  • 3.
    INDUSTRIAL TRAINING TwoTier Application Architecture Client Server
  • 4.
    INDUSTRIAL TRAINING TwoTier Application Architecture  Drawbacks - Easy to deploy but difficult to enchance or upgrade. - It makes reuse of business and presentation logic difficult - Not scalable and not suited for internet
  • 5.
    INDUSTRIAL TRAINING Java2 Platform Enterprise Edition(J2EE) J2EE is an architecture for implementing enterprise class applications using Java and Internet Technology - Solves problems of two tier architecture
  • 6.
    INDUSTRIAL TRAINING J2EE  To develop n tier application  It supports the development of a variety of application types  small client server systems  Systems running on Intranets  Systems on large scale internet e-commerce site
  • 7.
    INDUSTRIAL TRAINING J2EEFeatures  Component based model  Container provided services  Highly Scaleable  Simplified Architecture  Flexible security model
  • 8.
    INDUSTRIAL TRAINING Java:Foundation for J2EE  J2EE is an application of java  Write once and deploy the code into any platform
  • 9.
    INDUSTRIAL TRAINING J2EEComponents & Services  Primary technologies - Servlets - JavaServer Pages (JSP) - Enterprise JavaBeans (EJB)  Standard services & supporting technologies - Java database connectivity(JDBC) data access API - Remote Method Invocations (RMI) - Extensible Markup Languages(XML) - JavaIDL - JavaMail
  • 10.
    INDUSTRIAL TRAINING J2EETiers  Client Presentation  HTML or Java applets deployed in Browser  XML documentations transmitted through HTTP  Java clients running in Client Java Virtual Machine (JVM) • Presentation Logic  Servlets or JavaServer Pages running in web server • Application Logic  Enterprise JavaBeans running in Server
  • 11.
    INDUSTRIAL TRAINING J2EEApplication Model  Browser is able to process HTML and applets pages.  It forwards requests to the web server, which has JSPs and Servlets  Servlets and JSPs may access EJB server.  Java Standalone runs on java client, which access EJB server using RMI.
  • 12.
    INDUSTRIAL TRAINING J2EEApplication Model
  • 13.
    INDUSTRIAL TRAINING Overviewof Servlets  Are container managed web components  Replace Common Gateway Interface(CGI) or Active Server Pages (ASP)  Generate dynamic response to requests from web based clients  Synchronize multiple concurrent client request  Serve as client proxies
  • 14.
    INDUSTRIAL TRAINING ServletOperation  Server is Java program that runs as separate thread inside servlet container.  Servlet container is part of web server  It interact with web client using response request paradigm
  • 15.
    INDUSTRIAL TRAINING JavaServerPages (JSP)  Text based documents describe how to process a request and create a response  Contains HTML or XML and other JSP elements defined by JSP specification.  Are Installed on web server  are web components that sits on top of java servlet mode.
  • 16.
    INDUSTRIAL TRAINING JSPAdvantages  Performance  Runtime characteristics of servlets  Automatic recompilation of modified pages  Server side processing  Programming  Emphasize use of reusable components  Write Once , Run Anywhere properties  Extensible through custom tag libraries  Provides front end access mechanism to EJBs
  • 17.
    INDUSTRIAL TRAINING Partsof JSP Pages Directive <%@ pageimport=“java.util.”, MVCApp.Cart, MVCApp.CartItem” %> Declaration <%! Iterator it = null; CartItem ci = null; Vector cpi = null;%> Raw HTML <html><head><title>Shopping Cart</title></head></html> Action <jsp:usebean id =“Cart” scope = “session” class = “MVCApp.Cart”/> Scriplets % Cpi = cart.getCartItems ( ); it = cpi.iterator(); While (it.hasNext()){ci= (Cart Item)it.next(); %>
  • 18.
    INDUSTRIAL TRAINING Partsof JSP Pages  Expression <td<% = ci.getTitle() %></td> <td align =“right”><%=ci.getQuantity()%></td>  Implicit Objects <% string action = request.getParameter(“action”) ; %>
  • 19.