SlideShare a Scribd company logo
Krerk Piromsopa. Servlet & JSP 1
Introduction to Servlet & JSP
Krerk Piromsopa.
Department of Computer Engineering.
Chulalongkorn University
Krerk Piromsopa. Servlet & JSP 2
Servlet Technology
• JAVA APPLETs run on client side (in web browsers) or
writing Internet applications.
• JAVA SERVLETs run on server side for web-based
application. (No GUI is required)
• JAVA have built-in support for multithread.
• Servlet API is Standard Java Extension API, (NOT part of
core Java) and available as add-on package.
Krerk Piromsopa. Servlet & JSP 3
Servlets Overview
• Protocol and Platform-
independent server side Java
components
• Clients may range from simple
HTML forms to Java applets.
• Used as middle tiers for
distributed application systems.
Krerk Piromsopa. Servlet & JSP 4
Applications & Usage Modes.
• Database Connection.
• Synchronization (On-line
conferencing)
• Virtual Server management
• etc.
• Filter chains of Servers.
• HTTP
• CGI replacement
• Server side include
Krerk Piromsopa. Servlet & JSP 5
Security.
• Rely on HTTP-specific authentication
• Secure Socket Layer (SSL)
• Java advantage: no memory access violations, strong
typing violations. (Servlet will not crash servers.)
• Security Manager. Only trusted servlets will be allow to
access network services or local files.
• Support fine grained access control (more secure than MS.
ActiveX.)
Krerk Piromsopa. Servlet & JSP 6
Performance
Servlet run
as light
weight
thread in
process.
CGI run as
heavy
weight
process.
Krerk Piromsopa. Servlet & JSP 7
Three Tier Applications.
Krerk Piromsopa. Servlet & JSP 8
Sample Servlet
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class HelloWorld extends
HttpServlet {
public void doGet(HttpServletRequest
request, HttpServletResponse
response)
throws IOException, ServletException
{
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>");
}
Hello World!
Krerk Piromsopa. Servlet & JSP 9
JavaServer Pages VS. Servlets.
• Dynamic Page require for.
– Working on any web or application server
– Separating the application logic from the appearance of the page
– Allowing fast development and testing
– Simplifying the process of developing interactive web-based
applications
• JSP is a new approach to fit this need.
• Servlet ,to turn page, have to edit and recompile.
Krerk Piromsopa. Servlet & JSP 10
JavaServer Pages Approach.
• Separating content generation from presentation
• Emphasizing reusable components
• Simplifying page development with tags
• Java Technology benefits (memory management and
security.
• Scalability (integrated with J2EE)
Krerk Piromsopa. Servlet & JSP 11
JSP Example.
<HTML>
<%@ page language=="java" imports=="com.wombat.JSP.*" %>
<H1>Welcome</H1>
<P>Today is </P>
<jsp:useBean id=="clock" class=="calendar.jspCalendar" />
<UL>
<LI>Day: <%==clock.getDayOfMonth() %>
<LI>Year: <%==clock.getYear() %>
</UL>
<% if (Calendar.getInstance().get(Calendar.AM_PM) ==== Calendar.AM) { %>
Good Morning
<% } else { %>
Good Afternoon
<% } %>
<%@ include file=="copyright.html" %>
</HTML>
Krerk Piromsopa. Servlet & JSP 12
JSP components.
• JSP Directives
– <%@ …. %>
• JSP Tags
– <jsp:useBean … />
– <jsp:setProperty … />
– <jsp:getProperty … />
– <jsp:include … />
– <jsp:forward … />
• JSP expression
– <%== … %>
• Scripting Elements (scriptlet)
– <% ... %>
Krerk Piromsopa. Servlet & JSP 13
Application Model
• Simple Application
• Flexible Application with Java Servlets
Krerk Piromsopa. Servlet & JSP 14
Application Model (Continue)
• Scalable Processing with Enterprise JavaBeans
Technology.
Krerk Piromsopa. Servlet & JSP 15
References
• “JAVASERVER PAGES WHITE PAPER,”
http://java.sun.com/products/jsp/whitepaper.html
• “JAVA SERVLET TECHNOLOGY,”
http://java.sun.com/products/servlet/whitepaper.html

More Related Content

Similar to JSP-Servlet.ppt

Wt unit 3 server side technology
Wt unit 3 server side technologyWt unit 3 server side technology
Ppt for Online music store
Ppt for Online music storePpt for Online music store
Ppt for Online music store
ADEEBANADEEM
 
JSP Part 1
JSP Part 1JSP Part 1
JSP Part 1
DeeptiJava
 
Coursejspservlets00
Coursejspservlets00Coursejspservlets00
Coursejspservlets00
Rajesh Moorjani
 
Jeetrainers.com coursejspservlets00
Jeetrainers.com coursejspservlets00Jeetrainers.com coursejspservlets00
Jeetrainers.com coursejspservlets00
Rajesh Moorjani
 
Servlet 4.0 Adopt-a-JSR 10 Minute Infodeck
Servlet 4.0 Adopt-a-JSR 10 Minute InfodeckServlet 4.0 Adopt-a-JSR 10 Minute Infodeck
Servlet 4.0 Adopt-a-JSR 10 Minute Infodeck
Edward Burns
 
BITM3730Week12.pptx
BITM3730Week12.pptxBITM3730Week12.pptx
BITM3730Week12.pptx
MattMarino13
 
18CSC311J Web Design and Development UNIT-3
18CSC311J Web Design and Development UNIT-318CSC311J Web Design and Development UNIT-3
18CSC311J Web Design and Development UNIT-3
sivakumarmcs
 
Ecom 1
Ecom 1Ecom 1
Struts Into
Struts IntoStruts Into
Struts Into
Vijay subedar
 
01 Struts Intro
01 Struts Intro01 Struts Intro
01 Struts Intro
sdileepec
 
Core web application development
Core web application developmentCore web application development
Core web application development
Bahaa Farouk
 
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
 
presentation on online movie ticket booking
presentation on online movie ticket bookingpresentation on online movie ticket booking
presentation on online movie ticket booking
dharmawath
 
10 jsp-scripting-elements
10 jsp-scripting-elements10 jsp-scripting-elements
10 jsp-scripting-elements
Phạm Thu Thủy
 
AJ.pptx
AJ.pptxAJ.pptx
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
 Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1... Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
WebStackAcademy
 
Jsp(java server pages)
Jsp(java server pages)Jsp(java server pages)
Jsp(java server pages)
Khan Mac-arther
 
Jsp
JspJsp
Introduction to the Servlet / JSP course
Introduction to the Servlet / JSP course Introduction to the Servlet / JSP course
Introduction to the Servlet / JSP course
JavaEE Trainers
 

Similar to JSP-Servlet.ppt (20)

Wt unit 3 server side technology
Wt unit 3 server side technologyWt unit 3 server side technology
Wt unit 3 server side technology
 
Ppt for Online music store
Ppt for Online music storePpt for Online music store
Ppt for Online music store
 
JSP Part 1
JSP Part 1JSP Part 1
JSP Part 1
 
Coursejspservlets00
Coursejspservlets00Coursejspservlets00
Coursejspservlets00
 
Jeetrainers.com coursejspservlets00
Jeetrainers.com coursejspservlets00Jeetrainers.com coursejspservlets00
Jeetrainers.com coursejspservlets00
 
Servlet 4.0 Adopt-a-JSR 10 Minute Infodeck
Servlet 4.0 Adopt-a-JSR 10 Minute InfodeckServlet 4.0 Adopt-a-JSR 10 Minute Infodeck
Servlet 4.0 Adopt-a-JSR 10 Minute Infodeck
 
BITM3730Week12.pptx
BITM3730Week12.pptxBITM3730Week12.pptx
BITM3730Week12.pptx
 
18CSC311J Web Design and Development UNIT-3
18CSC311J Web Design and Development UNIT-318CSC311J Web Design and Development UNIT-3
18CSC311J Web Design and Development UNIT-3
 
Ecom 1
Ecom 1Ecom 1
Ecom 1
 
Struts Into
Struts IntoStruts Into
Struts Into
 
01 Struts Intro
01 Struts Intro01 Struts Intro
01 Struts Intro
 
Core web application development
Core web application developmentCore web application development
Core web application development
 
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
 
presentation on online movie ticket booking
presentation on online movie ticket bookingpresentation on online movie ticket booking
presentation on online movie ticket booking
 
10 jsp-scripting-elements
10 jsp-scripting-elements10 jsp-scripting-elements
10 jsp-scripting-elements
 
AJ.pptx
AJ.pptxAJ.pptx
AJ.pptx
 
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
 Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1... Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
 
Jsp(java server pages)
Jsp(java server pages)Jsp(java server pages)
Jsp(java server pages)
 
Jsp
JspJsp
Jsp
 
Introduction to the Servlet / JSP course
Introduction to the Servlet / JSP course Introduction to the Servlet / JSP course
Introduction to the Servlet / JSP course
 

More from MouDhara1

ppt_dcn.pdf
ppt_dcn.pdfppt_dcn.pdf
ppt_dcn.pdf
MouDhara1
 
datacommunicationnetworking-161025074805.pptx
datacommunicationnetworking-161025074805.pptxdatacommunicationnetworking-161025074805.pptx
datacommunicationnetworking-161025074805.pptx
MouDhara1
 
06 Recursion in C.pptx
06 Recursion in C.pptx06 Recursion in C.pptx
06 Recursion in C.pptx
MouDhara1
 
tree-160731205832.pptx
tree-160731205832.pptxtree-160731205832.pptx
tree-160731205832.pptx
MouDhara1
 
lecture-i-trees.ppt
lecture-i-trees.pptlecture-i-trees.ppt
lecture-i-trees.ppt
MouDhara1
 
09 Structures in C.pptx
09 Structures in C.pptx09 Structures in C.pptx
09 Structures in C.pptx
MouDhara1
 
Chapter 12 - Heaps.ppt
Chapter 12 - Heaps.pptChapter 12 - Heaps.ppt
Chapter 12 - Heaps.ppt
MouDhara1
 
Servlet.ppt
Servlet.pptServlet.ppt
Servlet.ppt
MouDhara1
 
DTD1.pptx
DTD1.pptxDTD1.pptx
DTD1.pptx
MouDhara1
 
04_Recurrences_1.ppt
04_Recurrences_1.ppt04_Recurrences_1.ppt
04_Recurrences_1.ppt
MouDhara1
 
STACK1.pptx
STACK1.pptxSTACK1.pptx
STACK1.pptx
MouDhara1
 
queue.pptx
queue.pptxqueue.pptx
queue.pptx
MouDhara1
 
javascript12.pptx
javascript12.pptxjavascript12.pptx
javascript12.pptx
MouDhara1
 
Linked list.pptx
Linked list.pptxLinked list.pptx
Linked list.pptx
MouDhara1
 
For Client vs.pptx
For Client vs.pptxFor Client vs.pptx
For Client vs.pptx
MouDhara1
 
Form tag.pptx
Form tag.pptxForm tag.pptx
Form tag.pptx
MouDhara1
 
Web technology.pptx
Web technology.pptxWeb technology.pptx
Web technology.pptx
MouDhara1
 
cse.pptx
cse.pptxcse.pptx
cse.pptx
MouDhara1
 
web tech.pptx
web tech.pptxweb tech.pptx
web tech.pptx
MouDhara1
 
Introduction to Data Structure.pptx
Introduction to Data Structure.pptxIntroduction to Data Structure.pptx
Introduction to Data Structure.pptx
MouDhara1
 

More from MouDhara1 (20)

ppt_dcn.pdf
ppt_dcn.pdfppt_dcn.pdf
ppt_dcn.pdf
 
datacommunicationnetworking-161025074805.pptx
datacommunicationnetworking-161025074805.pptxdatacommunicationnetworking-161025074805.pptx
datacommunicationnetworking-161025074805.pptx
 
06 Recursion in C.pptx
06 Recursion in C.pptx06 Recursion in C.pptx
06 Recursion in C.pptx
 
tree-160731205832.pptx
tree-160731205832.pptxtree-160731205832.pptx
tree-160731205832.pptx
 
lecture-i-trees.ppt
lecture-i-trees.pptlecture-i-trees.ppt
lecture-i-trees.ppt
 
09 Structures in C.pptx
09 Structures in C.pptx09 Structures in C.pptx
09 Structures in C.pptx
 
Chapter 12 - Heaps.ppt
Chapter 12 - Heaps.pptChapter 12 - Heaps.ppt
Chapter 12 - Heaps.ppt
 
Servlet.ppt
Servlet.pptServlet.ppt
Servlet.ppt
 
DTD1.pptx
DTD1.pptxDTD1.pptx
DTD1.pptx
 
04_Recurrences_1.ppt
04_Recurrences_1.ppt04_Recurrences_1.ppt
04_Recurrences_1.ppt
 
STACK1.pptx
STACK1.pptxSTACK1.pptx
STACK1.pptx
 
queue.pptx
queue.pptxqueue.pptx
queue.pptx
 
javascript12.pptx
javascript12.pptxjavascript12.pptx
javascript12.pptx
 
Linked list.pptx
Linked list.pptxLinked list.pptx
Linked list.pptx
 
For Client vs.pptx
For Client vs.pptxFor Client vs.pptx
For Client vs.pptx
 
Form tag.pptx
Form tag.pptxForm tag.pptx
Form tag.pptx
 
Web technology.pptx
Web technology.pptxWeb technology.pptx
Web technology.pptx
 
cse.pptx
cse.pptxcse.pptx
cse.pptx
 
web tech.pptx
web tech.pptxweb tech.pptx
web tech.pptx
 
Introduction to Data Structure.pptx
Introduction to Data Structure.pptxIntroduction to Data Structure.pptx
Introduction to Data Structure.pptx
 

Recently uploaded

Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
Aditya Rajan Patra
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
SUTEJAS
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
Rahul
 
A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...
nooriasukmaningtyas
 
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
zwunae
 
PROJECT FORMAT FOR EVS AMITY UNIVERSITY GWALIOR.ppt
PROJECT FORMAT FOR EVS AMITY UNIVERSITY GWALIOR.pptPROJECT FORMAT FOR EVS AMITY UNIVERSITY GWALIOR.ppt
PROJECT FORMAT FOR EVS AMITY UNIVERSITY GWALIOR.ppt
bhadouriyakaku
 
14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application
SyedAbiiAzazi1
 
basic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdfbasic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdf
NidhalKahouli2
 
Self-Control of Emotions by Slidesgo.pptx
Self-Control of Emotions by Slidesgo.pptxSelf-Control of Emotions by Slidesgo.pptx
Self-Control of Emotions by Slidesgo.pptx
iemerc2024
 
Building Electrical System Design & Installation
Building Electrical System Design & InstallationBuilding Electrical System Design & Installation
Building Electrical System Design & Installation
symbo111
 
Adaptive synchronous sliding control for a robot manipulator based on neural ...
Adaptive synchronous sliding control for a robot manipulator based on neural ...Adaptive synchronous sliding control for a robot manipulator based on neural ...
Adaptive synchronous sliding control for a robot manipulator based on neural ...
IJECEIAES
 
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTSHeap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Soumen Santra
 
DfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributionsDfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributions
gestioneergodomus
 
spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
Madan Karki
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
IJECEIAES
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
jpsjournal1
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
Hitesh Mohapatra
 
6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)
ClaraZara1
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
thanhdowork
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
insn4465
 

Recently uploaded (20)

Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
 
A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...
 
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
 
PROJECT FORMAT FOR EVS AMITY UNIVERSITY GWALIOR.ppt
PROJECT FORMAT FOR EVS AMITY UNIVERSITY GWALIOR.pptPROJECT FORMAT FOR EVS AMITY UNIVERSITY GWALIOR.ppt
PROJECT FORMAT FOR EVS AMITY UNIVERSITY GWALIOR.ppt
 
14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application
 
basic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdfbasic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdf
 
Self-Control of Emotions by Slidesgo.pptx
Self-Control of Emotions by Slidesgo.pptxSelf-Control of Emotions by Slidesgo.pptx
Self-Control of Emotions by Slidesgo.pptx
 
Building Electrical System Design & Installation
Building Electrical System Design & InstallationBuilding Electrical System Design & Installation
Building Electrical System Design & Installation
 
Adaptive synchronous sliding control for a robot manipulator based on neural ...
Adaptive synchronous sliding control for a robot manipulator based on neural ...Adaptive synchronous sliding control for a robot manipulator based on neural ...
Adaptive synchronous sliding control for a robot manipulator based on neural ...
 
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTSHeap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
 
DfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributionsDfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributions
 
spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
 
6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
 

JSP-Servlet.ppt

  • 1. Krerk Piromsopa. Servlet & JSP 1 Introduction to Servlet & JSP Krerk Piromsopa. Department of Computer Engineering. Chulalongkorn University
  • 2. Krerk Piromsopa. Servlet & JSP 2 Servlet Technology • JAVA APPLETs run on client side (in web browsers) or writing Internet applications. • JAVA SERVLETs run on server side for web-based application. (No GUI is required) • JAVA have built-in support for multithread. • Servlet API is Standard Java Extension API, (NOT part of core Java) and available as add-on package.
  • 3. Krerk Piromsopa. Servlet & JSP 3 Servlets Overview • Protocol and Platform- independent server side Java components • Clients may range from simple HTML forms to Java applets. • Used as middle tiers for distributed application systems.
  • 4. Krerk Piromsopa. Servlet & JSP 4 Applications & Usage Modes. • Database Connection. • Synchronization (On-line conferencing) • Virtual Server management • etc. • Filter chains of Servers. • HTTP • CGI replacement • Server side include
  • 5. Krerk Piromsopa. Servlet & JSP 5 Security. • Rely on HTTP-specific authentication • Secure Socket Layer (SSL) • Java advantage: no memory access violations, strong typing violations. (Servlet will not crash servers.) • Security Manager. Only trusted servlets will be allow to access network services or local files. • Support fine grained access control (more secure than MS. ActiveX.)
  • 6. Krerk Piromsopa. Servlet & JSP 6 Performance Servlet run as light weight thread in process. CGI run as heavy weight process.
  • 7. Krerk Piromsopa. Servlet & JSP 7 Three Tier Applications.
  • 8. Krerk Piromsopa. Servlet & JSP 8 Sample Servlet import java.io.*; import javax.servlet.*; import javax.servlet.http.*; public class HelloWorld extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { 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>"); } Hello World!
  • 9. Krerk Piromsopa. Servlet & JSP 9 JavaServer Pages VS. Servlets. • Dynamic Page require for. – Working on any web or application server – Separating the application logic from the appearance of the page – Allowing fast development and testing – Simplifying the process of developing interactive web-based applications • JSP is a new approach to fit this need. • Servlet ,to turn page, have to edit and recompile.
  • 10. Krerk Piromsopa. Servlet & JSP 10 JavaServer Pages Approach. • Separating content generation from presentation • Emphasizing reusable components • Simplifying page development with tags • Java Technology benefits (memory management and security. • Scalability (integrated with J2EE)
  • 11. Krerk Piromsopa. Servlet & JSP 11 JSP Example. <HTML> <%@ page language=="java" imports=="com.wombat.JSP.*" %> <H1>Welcome</H1> <P>Today is </P> <jsp:useBean id=="clock" class=="calendar.jspCalendar" /> <UL> <LI>Day: <%==clock.getDayOfMonth() %> <LI>Year: <%==clock.getYear() %> </UL> <% if (Calendar.getInstance().get(Calendar.AM_PM) ==== Calendar.AM) { %> Good Morning <% } else { %> Good Afternoon <% } %> <%@ include file=="copyright.html" %> </HTML>
  • 12. Krerk Piromsopa. Servlet & JSP 12 JSP components. • JSP Directives – <%@ …. %> • JSP Tags – <jsp:useBean … /> – <jsp:setProperty … /> – <jsp:getProperty … /> – <jsp:include … /> – <jsp:forward … /> • JSP expression – <%== … %> • Scripting Elements (scriptlet) – <% ... %>
  • 13. Krerk Piromsopa. Servlet & JSP 13 Application Model • Simple Application • Flexible Application with Java Servlets
  • 14. Krerk Piromsopa. Servlet & JSP 14 Application Model (Continue) • Scalable Processing with Enterprise JavaBeans Technology.
  • 15. Krerk Piromsopa. Servlet & JSP 15 References • “JAVASERVER PAGES WHITE PAPER,” http://java.sun.com/products/jsp/whitepaper.html • “JAVA SERVLET TECHNOLOGY,” http://java.sun.com/products/servlet/whitepaper.html