SlideShare a Scribd company logo
1 of 22
SARVAJANIK COLLEGE OF ENGINEERING AND TECHNOLOGY
COMPUTER ENGINEERING DEPARTMENT
B. E. III, CO – M, 6th Semester
ALA Presentation
On
“J2EE”
Subject Name : Advanced Java (2160707)
Prepared and Presented by (Group No. : 18)
SUVRA KANTI MANDAL(160420107065)
DITIRO RANKO(160420107068)
SYADA SARA ENAM ROJA(160420107069)
Guided by:
Prof. Bhavesh Patel
Prof. Vandana Joshi
Presentation Overview
• Introduction to J2EE
• 2-tier Architecture
• J2EE
• J2EE features
• J2EE Components
• J2EE Application Model
• Servlet
• JSP
2
Past History
• Initially two tier architecture (client server applications)
• Client is responsible for data access applying business logic a
nd presentation of data
• Only service provided by Server was that of database server.
3
Two Tier Application Architecture
Client Server
4
Two Tier Application Architecture
• Drawbacks
- Easy to deploy but difficult to
enhance or upgrade.
- It makes reuse of business and
presentation logic difficult
- Not scalable and not suited for
internet
5
Java 2 Platform Enterprise Editio
n (J2EE)
J2EE is an architecture for implementing enterprise class a
pplications using Java and Internet Technology
- Solves problems of two tier architecture
6
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 Java Server Pages running in web server
• Application Logic
Enterprise JavaBeans running in Server
7
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
8
J2EE Features
• Component based model
• Container provided services
• Highly Scalable
• Simplified Architecture
• Flexible security model
9
J2EE Components
10
J2EE Components & Services
• Primary technologies
- Servlets
- Java Server 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
11
J2EE Application Model
12
J2EE Application Model
• Browser is able to process HTML and applets pages.
• It forwards requests to the web server, which has JSPs and Se
rvlets
• Servlets and JSPs may access EJB server.
• Java Standalone runs on java client, which access EJB server
using RMI.
13
States and Persistence
• Session beans can be
• Stateless- belong to client for duration of a method call
• Stateful- belong to client for duration of client conversation
• Entity beans can have
• Bean-managed persistence- The developer writes SQL code to retrieve
, store and update database
• Container managed persistence- The developer provide database mapp
ing information that allows the container to manage persistence
14
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 client
s
• Synchronize multiple concurrent client request
• Serve as client proxies
15
Servlet Operation
• Server is Java program that ru
ns as separate thread inside ser
vlet container.
• Servlet container is part of we
b server
• It interact with web client usin
g response request paradigm
16
Sample Servlet
import java.io.*; //Apache Tomcat sample code
import javax.servlet.*;
import javax.servlet.http.*;
public class HelloWorld extends HttpServlet
{
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, Servlet
Exception
{
response.setContentType("text/html");
PrintWriter out = response.getWriter(); out.println("<html>"); out.println("<body>");
out.println("<head>");
out.println("<title>Hello World!</title>");
out.println("</head>");
out.println("<body>");
out.println("<h1>Hello World!</h1>");
out.println("</body>");
out.println("</html>");
}
}
17
Java Server 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.
18
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
19
Sample JSP
<html> <!- Apache Tomcat Samples ->
<!-- Copyright (c) 1999 The Apache Software Foundation. All rights reserved.-->
<body bgcolor="white">
<jsp:useBean id='clock' scope='page' class='dates.JspCalendar' type="dates.JspCalendar" />
<font size=4><ul>
<li> Day of month: is <jsp:getProperty name="clock" property="dayOfMonth"/>
<li> Year: is <jsp:getProperty name="clock" property="year"/>
<li> Month: is <jsp:getProperty name="clock" property="month"/>
<li> Time: is <jsp:getProperty name="clock" property="time"/>
<li> Date: is <jsp:getProperty name="clock" property="date"/>
<li> Day: is <jsp:getProperty name="clock" property="day"/>
<li> Day Of Year: is <jsp:getProperty name="clock" property="dayOfYear"/>
<li> Week Of Year: is <jsp:getProperty name="clock" property="weekOfYear"/>
<li> era: is <jsp:getProperty name="clock" property="era"/>
<li> DST Offset: is <jsp:getProperty name="clock" property="DSTOffset"/>
<li> Zone Offset: is <jsp:getProperty name="clock" property="zoneOffset"/>
</ul>
</font>
</body>
</html>
20
J2EE Servers
•Application Server
• As of Sept ’01 - MetaGroup Survey by sales $$
• BEA Weblogic - 37%
• IBM Websphere – 22%
• Oracle – 11%
• Iplanet – 5%
• Other- 12%
• Open-source
• Jboss – www.jboss.org
• Sun’s listing of J2EE compatible servers - http://java.sun.com/j2
ee/compatibility.html
21
Thank You…

More Related Content

Similar to AJ.pptx

Advance Java Topics (J2EE)
Advance Java Topics (J2EE)Advance Java Topics (J2EE)
Advance Java Topics (J2EE)slire
 
Lecture 19 dynamic web - java - part 1
Lecture 19   dynamic web - java - part 1Lecture 19   dynamic web - java - part 1
Lecture 19 dynamic web - java - part 1Д. Ганаа
 
Nitesh_Sr._Java_developer_Lead
Nitesh_Sr._Java_developer_Lead Nitesh_Sr._Java_developer_Lead
Nitesh_Sr._Java_developer_Lead Nitesh Dasari
 
Cloud compiler - Minor Project by students of CBPGEC
Cloud compiler - Minor Project by students of CBPGEC  Cloud compiler - Minor Project by students of CBPGEC
Cloud compiler - Minor Project by students of CBPGEC vipin kumar
 
Glassfish JEE Server Administration - JEE Introduction
Glassfish JEE Server Administration - JEE IntroductionGlassfish JEE Server Administration - JEE Introduction
Glassfish JEE Server Administration - JEE IntroductionDanairat Thanabodithammachari
 
Introduction to java_ee
Introduction to java_eeIntroduction to java_ee
Introduction to java_eeYogesh Bindwal
 
JAVA EE training from 3rd-oct-2015
JAVA EE training from 3rd-oct-2015JAVA EE training from 3rd-oct-2015
JAVA EE training from 3rd-oct-2015Naz Ish
 
J2EE PPT --CINTHIYA.M Krishnammal college for women
J2EE PPT --CINTHIYA.M Krishnammal college for womenJ2EE PPT --CINTHIYA.M Krishnammal college for women
J2EE PPT --CINTHIYA.M Krishnammal college for womenlissa cidhi
 
What's New in IBM Java 8 SE?
What's New in IBM Java 8 SE?What's New in IBM Java 8 SE?
What's New in IBM Java 8 SE?Tim Ellison
 
Java EE8 - by Kito Mann
Java EE8 - by Kito Mann Java EE8 - by Kito Mann
Java EE8 - by Kito Mann Kile Niklawski
 
JavaOne 2014 Java EE 8 Booth Slides
JavaOne 2014 Java EE 8 Booth SlidesJavaOne 2014 Java EE 8 Booth Slides
JavaOne 2014 Java EE 8 Booth SlidesEdward Burns
 
BITM3730Week12.pptx
BITM3730Week12.pptxBITM3730Week12.pptx
BITM3730Week12.pptxMattMarino13
 
EJB 3.0 Java Persistence with Oracle TopLink
EJB 3.0 Java Persistence with Oracle TopLinkEJB 3.0 Java Persistence with Oracle TopLink
EJB 3.0 Java Persistence with Oracle TopLinkBill Lyons
 
JavaScript, often abbreviated as JS, is a programming language and core techn...
JavaScript, often abbreviated as JS, is a programming language and core techn...JavaScript, often abbreviated as JS, is a programming language and core techn...
JavaScript, often abbreviated as JS, is a programming language and core techn...MathivananP4
 
Ppt for Online music store
Ppt for Online music storePpt for Online music store
Ppt for Online music storeADEEBANADEEM
 
OTN Developer Days - Java EE 6
OTN Developer Days - Java EE 6OTN Developer Days - Java EE 6
OTN Developer Days - Java EE 6glassfish
 

Similar to AJ.pptx (20)

Jsp
JspJsp
Jsp
 
Advance Java Topics (J2EE)
Advance Java Topics (J2EE)Advance Java Topics (J2EE)
Advance Java Topics (J2EE)
 
Lecture 19 dynamic web - java - part 1
Lecture 19   dynamic web - java - part 1Lecture 19   dynamic web - java - part 1
Lecture 19 dynamic web - java - part 1
 
Nitesh_Sr._Java_developer_Lead
Nitesh_Sr._Java_developer_Lead Nitesh_Sr._Java_developer_Lead
Nitesh_Sr._Java_developer_Lead
 
Cloud compiler - Minor Project by students of CBPGEC
Cloud compiler - Minor Project by students of CBPGEC  Cloud compiler - Minor Project by students of CBPGEC
Cloud compiler - Minor Project by students of CBPGEC
 
Glassfish JEE Server Administration - JEE Introduction
Glassfish JEE Server Administration - JEE IntroductionGlassfish JEE Server Administration - JEE Introduction
Glassfish JEE Server Administration - JEE Introduction
 
Java part 3
Java part  3Java part  3
Java part 3
 
Introduction to java_ee
Introduction to java_eeIntroduction to java_ee
Introduction to java_ee
 
JAVA EE training from 3rd-oct-2015
JAVA EE training from 3rd-oct-2015JAVA EE training from 3rd-oct-2015
JAVA EE training from 3rd-oct-2015
 
J2EE PPT --CINTHIYA.M Krishnammal college for women
J2EE PPT --CINTHIYA.M Krishnammal college for womenJ2EE PPT --CINTHIYA.M Krishnammal college for women
J2EE PPT --CINTHIYA.M Krishnammal college for women
 
What's New in IBM Java 8 SE?
What's New in IBM Java 8 SE?What's New in IBM Java 8 SE?
What's New in IBM Java 8 SE?
 
Java EE8 - by Kito Mann
Java EE8 - by Kito Mann Java EE8 - by Kito Mann
Java EE8 - by Kito Mann
 
Lec2 ecom fall16
Lec2 ecom fall16Lec2 ecom fall16
Lec2 ecom fall16
 
JavaOne 2014 Java EE 8 Booth Slides
JavaOne 2014 Java EE 8 Booth SlidesJavaOne 2014 Java EE 8 Booth Slides
JavaOne 2014 Java EE 8 Booth Slides
 
BITM3730Week12.pptx
BITM3730Week12.pptxBITM3730Week12.pptx
BITM3730Week12.pptx
 
EJB 3.0 Java Persistence with Oracle TopLink
EJB 3.0 Java Persistence with Oracle TopLinkEJB 3.0 Java Persistence with Oracle TopLink
EJB 3.0 Java Persistence with Oracle TopLink
 
JavaScript, often abbreviated as JS, is a programming language and core techn...
JavaScript, often abbreviated as JS, is a programming language and core techn...JavaScript, often abbreviated as JS, is a programming language and core techn...
JavaScript, often abbreviated as JS, is a programming language and core techn...
 
Ppt for Online music store
Ppt for Online music storePpt for Online music store
Ppt for Online music store
 
OTN Developer Days - Java EE 6
OTN Developer Days - Java EE 6OTN Developer Days - Java EE 6
OTN Developer Days - Java EE 6
 
J2EE Introduction
J2EE IntroductionJ2EE Introduction
J2EE Introduction
 

Recently uploaded

Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 

Recently uploaded (20)

Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 

AJ.pptx

  • 1. SARVAJANIK COLLEGE OF ENGINEERING AND TECHNOLOGY COMPUTER ENGINEERING DEPARTMENT B. E. III, CO – M, 6th Semester ALA Presentation On “J2EE” Subject Name : Advanced Java (2160707) Prepared and Presented by (Group No. : 18) SUVRA KANTI MANDAL(160420107065) DITIRO RANKO(160420107068) SYADA SARA ENAM ROJA(160420107069) Guided by: Prof. Bhavesh Patel Prof. Vandana Joshi
  • 2. Presentation Overview • Introduction to J2EE • 2-tier Architecture • J2EE • J2EE features • J2EE Components • J2EE Application Model • Servlet • JSP 2
  • 3. Past History • Initially two tier architecture (client server applications) • Client is responsible for data access applying business logic a nd presentation of data • Only service provided by Server was that of database server. 3
  • 4. Two Tier Application Architecture Client Server 4
  • 5. Two Tier Application Architecture • Drawbacks - Easy to deploy but difficult to enhance or upgrade. - It makes reuse of business and presentation logic difficult - Not scalable and not suited for internet 5
  • 6. Java 2 Platform Enterprise Editio n (J2EE) J2EE is an architecture for implementing enterprise class a pplications using Java and Internet Technology - Solves problems of two tier architecture 6
  • 7. 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 Java Server Pages running in web server • Application Logic Enterprise JavaBeans running in Server 7
  • 8. 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 8
  • 9. J2EE Features • Component based model • Container provided services • Highly Scalable • Simplified Architecture • Flexible security model 9
  • 11. J2EE Components & Services • Primary technologies - Servlets - Java Server 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 11
  • 13. J2EE Application Model • Browser is able to process HTML and applets pages. • It forwards requests to the web server, which has JSPs and Se rvlets • Servlets and JSPs may access EJB server. • Java Standalone runs on java client, which access EJB server using RMI. 13
  • 14. States and Persistence • Session beans can be • Stateless- belong to client for duration of a method call • Stateful- belong to client for duration of client conversation • Entity beans can have • Bean-managed persistence- The developer writes SQL code to retrieve , store and update database • Container managed persistence- The developer provide database mapp ing information that allows the container to manage persistence 14
  • 15. 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 client s • Synchronize multiple concurrent client request • Serve as client proxies 15
  • 16. Servlet Operation • Server is Java program that ru ns as separate thread inside ser vlet container. • Servlet container is part of we b server • It interact with web client usin g response request paradigm 16
  • 17. Sample Servlet import java.io.*; //Apache Tomcat sample code import javax.servlet.*; import javax.servlet.http.*; public class HelloWorld extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, Servlet Exception { response.setContentType("text/html"); PrintWriter out = response.getWriter(); out.println("<html>"); out.println("<body>"); out.println("<head>"); out.println("<title>Hello World!</title>"); out.println("</head>"); out.println("<body>"); out.println("<h1>Hello World!</h1>"); out.println("</body>"); out.println("</html>"); } } 17
  • 18. Java Server 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. 18
  • 19. 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 19
  • 20. Sample JSP <html> <!- Apache Tomcat Samples -> <!-- Copyright (c) 1999 The Apache Software Foundation. All rights reserved.--> <body bgcolor="white"> <jsp:useBean id='clock' scope='page' class='dates.JspCalendar' type="dates.JspCalendar" /> <font size=4><ul> <li> Day of month: is <jsp:getProperty name="clock" property="dayOfMonth"/> <li> Year: is <jsp:getProperty name="clock" property="year"/> <li> Month: is <jsp:getProperty name="clock" property="month"/> <li> Time: is <jsp:getProperty name="clock" property="time"/> <li> Date: is <jsp:getProperty name="clock" property="date"/> <li> Day: is <jsp:getProperty name="clock" property="day"/> <li> Day Of Year: is <jsp:getProperty name="clock" property="dayOfYear"/> <li> Week Of Year: is <jsp:getProperty name="clock" property="weekOfYear"/> <li> era: is <jsp:getProperty name="clock" property="era"/> <li> DST Offset: is <jsp:getProperty name="clock" property="DSTOffset"/> <li> Zone Offset: is <jsp:getProperty name="clock" property="zoneOffset"/> </ul> </font> </body> </html> 20
  • 21. J2EE Servers •Application Server • As of Sept ’01 - MetaGroup Survey by sales $$ • BEA Weblogic - 37% • IBM Websphere – 22% • Oracle – 11% • Iplanet – 5% • Other- 12% • Open-source • Jboss – www.jboss.org • Sun’s listing of J2EE compatible servers - http://java.sun.com/j2 ee/compatibility.html 21