SlideShare a Scribd company logo
1 of 28
Riza Muhammad Nurman 4SC
Click to edit Master title style
Chapter 2
on
4SC Q7M2
Chapter 2
on
4SC Q7M2
FACULTYFACULTY
Riza Muhammad NurmanRiza Muhammad Nurman
Exploring the java Servlet TechnologyExploring the java Servlet Technology
Facebook : https://facebook.com/rizamanFacebook : https://facebook.com/rizaman
Twitter : https://twitter.com/rhyzoneTwitter : https://twitter.com/rhyzone
SlideShare : https://slideshare.net/rizamanSlideShare : https://slideshare.net/rizaman
Riza Muhammad Nurman 4SC
Click to edit Master title styleContent
• Introduce servlet
• Implement servlets
Riza Muhammad Nurman 4SC
Click to edit Master title styleIntroduction to Servlets
• Web  used as a medium entertainment, business,
and socializing
• Ex: Google website
• Servlet is a Java program that runs on the server side
• Servlet features:
– Efficient :
• Servlets provide faster response to the client requests as it is loaded
only once in the Web server memory
– Asynchronous support :
• Servlet supports asynchronous programming that enables it to serve
multiple client requests and generate responses simultaneously
Riza Muhammad Nurman 4SC
Click to edit Master title styleThe Servlet API
• To create and manage
servlets, various interfaces,
classes, and methods are
defined in the Servlet API
• Classes and interafaces of
the Servlet API are available
in the following packages:
– javax.servlet
– javax.servlet.http
Servlet API
javax.servlet javax.servlet.http
GenericServlet
ServletException
Servlet
RequestDispatcher
ServletConfig
ServletRequest
ServletResponse
ServletContext
AsyncContext
HttpServlet
Cookie
HttpServletRequest
HttpServletResponse
HttpSession
Packages
Classes
Interfaces
The Servlet API Hierarchy
Riza Muhammad Nurman 4SC
Click to edit Master title styleThe javax.servlet Package
Interface Description
Servlet It provides the methods that all servlets must implement
ServletConfig It provides information to the servlets during the servlet initialization
ServletContext It provides methods, which is used by the servlets to communicate
with the Web container
ServletRequest It provides the client request information to the servlet
ServletResponse It helps the servlet in sending the response to the client
RequestDispatcher It receives a request from a client and sends it to any other resource,
such as a servlet, an HTML page, or a JSP page
AsyncContext It provides the methods to handle multiple client requests
asynchronously
Riza Muhammad Nurman 4SC
Click to edit Master title styleThe Methods of the Servlet Interface
Interface Description
void init(ServletConfig config) throws
ServletException
It is called by the servlet container to indicate to a
servlet that the servlet is being placed into service
ServletConfig getServletConfig() Returns a ServletConfig object, which contains
initialization and startup parameters for this servlet
String getServletInfo() Returns information about the servlet, such as author,
version, and copyright
void service(ServletRequest request,
ServletResponse response) throws
ServletException, IOException
It is Called by the servlet container to allow the servlet
to respond to a request
void destroy() Called by the servlet container to indicate to a servlet
that the servlet is being taken out of service
Riza Muhammad Nurman 4SC
Click to edit Master title styleThe Methods of the ServletRequest Interface
Interface Description
String getParameter(String
paramName)
Returns a String object that specifies the value of a
particular request parameter
public String[]
getParameterValues(String
paramName)
Returns an array of String objects that contains all the
values of the request parameter
public Enumeration
getParameterNames()
Returns an Enumeration object containing all the
parameter names as String objects that `request
contains
public String getRemoteHost() Returns a String object that specifies the full-qualified
name of the computer from which the request is sent
public String getRemoteAddr() Returns a String object that specifies the IP address of
the computer from which the request is sent
Riza Muhammad Nurman 4SC
Click to edit Master title styleThe Methods of the ServletResponse Interface
Interface Description
public ServletOutputStream
getOutputStream() throws
IOException
Returns an object of the ServletOutputStream class
that represents an output stream to send binary data
as response
public PrintWriter getWriter() throws
IOException
Returns an object of the PrintWriter class that the
servlet uses to send character data as response
public void setContentType(String
type)
Sets the MIME type for a servlet response. Some of the
MIME types are text/lain, image/jpeg, and text/html.
Riza Muhammad Nurman 4SC
Click to edit Master title styleThe Interfaces of the javax.servlet.http Package
Interface Description
HttpServletRequest It extends the ServletRequest interface to represent
the request information being sent to the HTTP
servlets by an HTTP client
HttpServletResponse It extends the ServletResponse interface and provides
methods to handle response, status codes, and
response headers of the servlets that communicate
using HTTP
HttpSession It provides mechanism that helps in identifying a client
across multiple requests
Riza Muhammad Nurman 4SC
Click to edit Master title styleCode Snippet “MyServlet”
1. import javax.servlet.http.HttpServlet;
2. import javax.servlet.http.HttpServletRequest;
3. import javax.servlet.http.HttpServletResponse;
4. public class MyServlet extends HttpServlet {
5. protected void doGet(HttpServletRequest request, HttpServletResponse
response)
6. throws ServletException, IOException {
7.
8. }
9. protected void doPost(HttpServletRequest request, HttpServletResponse
response)
10. throws ServletException, IOException {
11.
12. }
13. }
14. }
Riza Muhammad Nurman 4SC
Click to edit Master title styleUnderstanding the Web Container
• Web Container is a component of the Web server which
provides the run-time environment for executing the servlets
• Web container implements the Servlet APIs
– Communication Support : The Web container provides communication
support that a servlet can communicate with the Web server
– Lifecycle Management : The Web container manages the lifecycle of the
servlets.
– Multithreading Support : The Web container provides multithreading
support for every servlet
– Declarative Security : The Web container defines the security
constraints that specify that only the authorized users can access the
deployed servlets
– JSP Support : The Web container compiles and translates the JSP pages
into the servlet class files, which are then used to process the requests
of a client
Riza Muhammad Nurman 4SC
Click to edit Master title styleThe Web Container Architecture
Riza Muhammad Nurman 4SC
Click to edit Master title styleThe Web Container Architecture - 2
Riza Muhammad Nurman 4SC
Click to edit Master title styleThe Web Container Architecture - 3
Riza Muhammad Nurman 4SC
Click to edit Master title styleThe Web Container Architecture - 4
Riza Muhammad Nurman 4SC
Click to edit Master title styleThe Web Container Architecture - 5
Riza Muhammad Nurman 4SC
Click to edit Master title styleLife Cycle of a Servlet
• init()
– The method is called during initialization phase of the servlet life cycle
• service()
– To process client request
• destroy()
– The method marks the end of the life cycle of a servlet
public void init(ServletConfig config) throws ServletException {
...
}
protected void service(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
...
}
public void destroy() {
...
}
Riza Muhammad Nurman 4SC
Click to edit Master title styleImplementing Servlets – Create a New project
Pilih kategori
Java Web
Pilih Projects
Web Application
Riza Muhammad Nurman 4SC
Click to edit Master title styleWeb Application Structure
• The root directory
– Contains static resources : HTML files, JSP
files, and image files
• The WEB-INF directory inside the root
directory
– Contains the application deployment
descriptor file, web.xml, which stores
various configurations of a Web
application
• The classes directory
– Contains the class files of the application
• The lib directory
– Contains Java Archive (JAR) files of
libraries
Riza Muhammad Nurman 4SC
Click to edit Master title styleindex.html
1. <!DOCTYPE html>
2. <!--
3. To change this license header, choose License Headers in Project Properties.
4. To change this template file, choose Tools | Templates
5. and open the template in the editor.
6. -->
7. <html>
8. <head>
9. <title>TODO supply a title</title>
10. <meta charset="UTF-8">
11. <meta name="viewport" content="width=device-width, initial-scale=1.0">
12. </head>
13. <body>
14. <div>TODO write content</div>
15. </body>
16. </html>
Riza Muhammad Nurman 4SC
Click to edit Master title styleCreating a Servlet
• Packages : myservlet
• Servlet Name : CurrentData
Riza Muhammad Nurman 4SC
Click to edit Master title styleConfiguring a Servlet Using DD File
1. <?xml version="1.0" encoding="UTF-8"?>
2. <web-app version="3.1"
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-
instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd">
3. <servlet>
4. <servlet-name>CurrentDate</servlet-name>
5. <servlet-class>myservlet.CurrentDate</servlet-class>
6. </servlet>
7. <servlet-mapping>
8. <servlet-name>CurrentDate</servlet-name>
9. <url-pattern>/CurrentDate</url-pattern>
10. </servlet-mapping>
11. <session-config>
12. <session-timeout>
13. 30
14. </session-timeout>
15. </session-config>
16. </web-app>
Riza Muhammad Nurman 4SC
Click to edit Master title styleConfiguring a Servlet Using Annotations
1. @WebServlet(name =
"CurrentDate", urlPatterns =
{"/CurrentDate"})
2. public class CurrentDate
extends HttpServlet {
3. …
4. }
Riza Muhammad Nurman 4SC
Click to edit Master title styleServlet CurrentDate
Riza Muhammad Nurman 4SC
Click to edit Master title styleprocessRequest Method
1. protected void processRequest(HttpServletRequest request,
HttpServletResponse response)
2. throws ServletException, IOException {
3. response.setContentType("text/html;charset=UTF-8");
4. try (PrintWriter out = response.getWriter()) {
5. /* TODO output your page here. You may use following sample code. */
6. out.println("<!DOCTYPE html>");
7. out.println("<html>");
8. out.println("<head>");
9. out.println("<title>Servlet CurrentDate</title>");
10. out.println("</head>");
11. out.println("<body>");
12. out.println("<h1>Servlet CurrentDate at " + request.getContextPath() +
"</h1>");
13. out.println("</body>");
14. out.println("</html>");
15. }
16. }
Riza Muhammad Nurman 4SC
Click to edit Master title styleOthers Method
1. @Override
2. protected void doGet(HttpServletRequest request, HttpServletResponse
response)
3. throws ServletException, IOException {
4. processRequest(request, response);
5. }
6. @Override
7. protected void doPost(HttpServletRequest request,
HttpServletResponse response)
8. throws ServletException, IOException {
9. processRequest(request, response);
10. }
11. @Override
12. public String getServletInfo() {
13. return "Short description";
14. }
Riza Muhammad Nurman 4SC
Click to edit Master title styleSample
1. protected void processRequest(HttpServletRequest request, HttpServletResponse response)
2. throws ServletException, IOException {
3. response.setContentType("text/html;charset=UTF-8");
4. try (PrintWriter out = response.getWriter()) {
5. /* TODO output your page here. You may use following sample code. */
6. out.println("<!DOCTYPE html>");
7. out.println("<html>");
8. out.println("<head>");
9. out.println("<title>Hello World</title>");
10. out.println("</head>");
11. out.println("<body>");
12. out.println("<h1>"+ new java.util.Date() +"</h1>");
13. out.println("</body>");
14. out.println("</html>");
15. }
16. }
Riza Muhammad Nurman 4SC
Click to edit Master title style

More Related Content

What's hot

JEE Course - The Web Tier
JEE Course - The Web TierJEE Course - The Web Tier
JEE Course - The Web Tierodedns
 
Service Oriented Integration With ServiceMix
Service Oriented Integration With ServiceMixService Oriented Integration With ServiceMix
Service Oriented Integration With ServiceMixBruce Snyder
 
ServiceMix 4 -- Integrating OSGi with JBI
ServiceMix 4 -- Integrating OSGi with JBIServiceMix 4 -- Integrating OSGi with JBI
ServiceMix 4 -- Integrating OSGi with JBIGert Vanthienen
 
Servlets 3.0 - Asynchronous, Easy, Extensible @ Silicon Valley Code Camp 2010
Servlets 3.0 - Asynchronous, Easy, Extensible @ Silicon Valley Code Camp 2010Servlets 3.0 - Asynchronous, Easy, Extensible @ Silicon Valley Code Camp 2010
Servlets 3.0 - Asynchronous, Easy, Extensible @ Silicon Valley Code Camp 2010Arun Gupta
 
WebLogic JMS System Best Practices
WebLogic JMS System Best PracticesWebLogic JMS System Best Practices
WebLogic JMS System Best PracticesTrivadis
 
Websphere interview Questions
Websphere interview QuestionsWebsphere interview Questions
Websphere interview Questionsgummadi1
 
Servletarchitecture,lifecycle,get,post
Servletarchitecture,lifecycle,get,postServletarchitecture,lifecycle,get,post
Servletarchitecture,lifecycle,get,postvamsi krishna
 
Server-Side Programming Primer
Server-Side Programming PrimerServer-Side Programming Primer
Server-Side Programming PrimerIvano Malavolta
 
An Introduction to Apache ServiceMix 4 - FUSE ESB
An Introduction to Apache ServiceMix 4 - FUSE ESBAn Introduction to Apache ServiceMix 4 - FUSE ESB
An Introduction to Apache ServiceMix 4 - FUSE ESBAdrian Trenaman
 
Service Oriented Integration with ServiceMix
Service Oriented Integration with ServiceMixService Oriented Integration with ServiceMix
Service Oriented Integration with ServiceMixghessler
 

What's hot (20)

Aspdotnet
AspdotnetAspdotnet
Aspdotnet
 
JEE Course - The Web Tier
JEE Course - The Web TierJEE Course - The Web Tier
JEE Course - The Web Tier
 
Java Servlets
Java ServletsJava Servlets
Java Servlets
 
Service Oriented Integration With ServiceMix
Service Oriented Integration With ServiceMixService Oriented Integration With ServiceMix
Service Oriented Integration With ServiceMix
 
ServiceMix 4 -- Integrating OSGi with JBI
ServiceMix 4 -- Integrating OSGi with JBIServiceMix 4 -- Integrating OSGi with JBI
ServiceMix 4 -- Integrating OSGi with JBI
 
WebLogic FAQs
WebLogic FAQsWebLogic FAQs
WebLogic FAQs
 
Servlets 3.0 - Asynchronous, Easy, Extensible @ Silicon Valley Code Camp 2010
Servlets 3.0 - Asynchronous, Easy, Extensible @ Silicon Valley Code Camp 2010Servlets 3.0 - Asynchronous, Easy, Extensible @ Silicon Valley Code Camp 2010
Servlets 3.0 - Asynchronous, Easy, Extensible @ Silicon Valley Code Camp 2010
 
WebLogic JMS System Best Practices
WebLogic JMS System Best PracticesWebLogic JMS System Best Practices
WebLogic JMS System Best Practices
 
Websphere interview Questions
Websphere interview QuestionsWebsphere interview Questions
Websphere interview Questions
 
Servletarchitecture,lifecycle,get,post
Servletarchitecture,lifecycle,get,postServletarchitecture,lifecycle,get,post
Servletarchitecture,lifecycle,get,post
 
Servlets
ServletsServlets
Servlets
 
RESTful Web Services
RESTful Web ServicesRESTful Web Services
RESTful Web Services
 
Server-Side Programming Primer
Server-Side Programming PrimerServer-Side Programming Primer
Server-Side Programming Primer
 
Mongo db eng
Mongo db engMongo db eng
Mongo db eng
 
Apache servicemix1
Apache servicemix1Apache servicemix1
Apache servicemix1
 
An Introduction to Apache ServiceMix 4 - FUSE ESB
An Introduction to Apache ServiceMix 4 - FUSE ESBAn Introduction to Apache ServiceMix 4 - FUSE ESB
An Introduction to Apache ServiceMix 4 - FUSE ESB
 
Asif
AsifAsif
Asif
 
Service Oriented Integration with ServiceMix
Service Oriented Integration with ServiceMixService Oriented Integration with ServiceMix
Service Oriented Integration with ServiceMix
 
Servlets
ServletsServlets
Servlets
 
HTML5 Refresher
HTML5 RefresherHTML5 Refresher
HTML5 Refresher
 

Similar to Exploring the Java Servlet Technology

Java Servlet Programming under Ubuntu Linux by Tushar B Kute
Java Servlet Programming under Ubuntu Linux by Tushar B KuteJava Servlet Programming under Ubuntu Linux by Tushar B Kute
Java Servlet Programming under Ubuntu Linux by Tushar B KuteTushar B Kute
 
Java servlet technology
Java servlet technologyJava servlet technology
Java servlet technologyMinal Maniar
 
Bt0083 server side programing
Bt0083 server side programing Bt0083 server side programing
Bt0083 server side programing Techglyphs
 
Liit tyit sem 5 enterprise java unit 1 notes 2018
Liit tyit sem 5 enterprise java  unit 1 notes 2018 Liit tyit sem 5 enterprise java  unit 1 notes 2018
Liit tyit sem 5 enterprise java unit 1 notes 2018 tanujaparihar
 
Knowledge Sharing : Java Servlet
Knowledge Sharing : Java ServletKnowledge Sharing : Java Servlet
Knowledge Sharing : Java ServletFahmi Jafar
 
Java Servlet
Java ServletJava Servlet
Java ServletYoga Raja
 
Web container and Apache Tomcat
Web container and Apache TomcatWeb container and Apache Tomcat
Web container and Apache TomcatAuwal Amshi
 
1 java servlets and jsp
1   java servlets and jsp1   java servlets and jsp
1 java servlets and jspAnkit Minocha
 
Http Server Programming in JAVA - Handling http requests and responses
Http Server Programming in JAVA - Handling http requests and responsesHttp Server Programming in JAVA - Handling http requests and responses
Http Server Programming in JAVA - Handling http requests and responsesbharathiv53
 
Servlet ppt by vikas jagtap
Servlet ppt by vikas jagtapServlet ppt by vikas jagtap
Servlet ppt by vikas jagtapVikas Jagtap
 
java Servlet technology
java Servlet technologyjava Servlet technology
java Servlet technologyTanmoy Barman
 
Introduction to java servlet 3.0 api javaone 2009
Introduction to java servlet 3.0 api javaone 2009Introduction to java servlet 3.0 api javaone 2009
Introduction to java servlet 3.0 api javaone 2009JavaEE Trainers
 
Spring Portlet MVC
Spring Portlet MVCSpring Portlet MVC
Spring Portlet MVCJohn Lewis
 

Similar to Exploring the Java Servlet Technology (20)

Java Servlet Programming under Ubuntu Linux by Tushar B Kute
Java Servlet Programming under Ubuntu Linux by Tushar B KuteJava Servlet Programming under Ubuntu Linux by Tushar B Kute
Java Servlet Programming under Ubuntu Linux by Tushar B Kute
 
Servlets
ServletsServlets
Servlets
 
Java servlet technology
Java servlet technologyJava servlet technology
Java servlet technology
 
Bt0083 server side programing
Bt0083 server side programing Bt0083 server side programing
Bt0083 server side programing
 
Liit tyit sem 5 enterprise java unit 1 notes 2018
Liit tyit sem 5 enterprise java  unit 1 notes 2018 Liit tyit sem 5 enterprise java  unit 1 notes 2018
Liit tyit sem 5 enterprise java unit 1 notes 2018
 
Knowledge Sharing : Java Servlet
Knowledge Sharing : Java ServletKnowledge Sharing : Java Servlet
Knowledge Sharing : Java Servlet
 
JAVA Servlets
JAVA ServletsJAVA Servlets
JAVA Servlets
 
Java Servlets
Java ServletsJava Servlets
Java Servlets
 
Java Servlet
Java ServletJava Servlet
Java Servlet
 
Web container and Apache Tomcat
Web container and Apache TomcatWeb container and Apache Tomcat
Web container and Apache Tomcat
 
1 java servlets and jsp
1   java servlets and jsp1   java servlets and jsp
1 java servlets and jsp
 
Http Server Programming in JAVA - Handling http requests and responses
Http Server Programming in JAVA - Handling http requests and responsesHttp Server Programming in JAVA - Handling http requests and responses
Http Server Programming in JAVA - Handling http requests and responses
 
Unit5 servlets
Unit5 servletsUnit5 servlets
Unit5 servlets
 
Servlet ppt by vikas jagtap
Servlet ppt by vikas jagtapServlet ppt by vikas jagtap
Servlet ppt by vikas jagtap
 
java Servlet technology
java Servlet technologyjava Servlet technology
java Servlet technology
 
Servlet by Rj
Servlet by RjServlet by Rj
Servlet by Rj
 
Introduction to java servlet 3.0 api javaone 2009
Introduction to java servlet 3.0 api javaone 2009Introduction to java servlet 3.0 api javaone 2009
Introduction to java servlet 3.0 api javaone 2009
 
Basics Of Servlet
Basics Of ServletBasics Of Servlet
Basics Of Servlet
 
AJppt.pptx
AJppt.pptxAJppt.pptx
AJppt.pptx
 
Spring Portlet MVC
Spring Portlet MVCSpring Portlet MVC
Spring Portlet MVC
 

More from Riza Nurman

SE - Chapter 9 Pemeliharaan Perangkat Lunak
SE - Chapter 9 Pemeliharaan Perangkat LunakSE - Chapter 9 Pemeliharaan Perangkat Lunak
SE - Chapter 9 Pemeliharaan Perangkat LunakRiza Nurman
 
SE - Chapter 8 Strategi Pengujian Perangkat Lunak
SE - Chapter 8 Strategi Pengujian Perangkat LunakSE - Chapter 8 Strategi Pengujian Perangkat Lunak
SE - Chapter 8 Strategi Pengujian Perangkat LunakRiza Nurman
 
SE - Chapter 7 Teknik Pengujian Perangkat Lunak
SE - Chapter 7 Teknik Pengujian Perangkat LunakSE - Chapter 7 Teknik Pengujian Perangkat Lunak
SE - Chapter 7 Teknik Pengujian Perangkat LunakRiza Nurman
 
SE - Chapter 6 Tim dan Kualitas Perangkat Lunak
SE - Chapter 6 Tim dan Kualitas Perangkat LunakSE - Chapter 6 Tim dan Kualitas Perangkat Lunak
SE - Chapter 6 Tim dan Kualitas Perangkat LunakRiza Nurman
 
XML - Chapter 8 WEB SERVICES
XML - Chapter 8 WEB SERVICESXML - Chapter 8 WEB SERVICES
XML - Chapter 8 WEB SERVICESRiza Nurman
 
XML - Chapter 7 XML DAN DATABASE
XML - Chapter 7 XML DAN DATABASEXML - Chapter 7 XML DAN DATABASE
XML - Chapter 7 XML DAN DATABASERiza Nurman
 
XML - Chapter 6 SIMPLE API FOR XML (SAX)
XML - Chapter 6 SIMPLE API FOR XML (SAX)XML - Chapter 6 SIMPLE API FOR XML (SAX)
XML - Chapter 6 SIMPLE API FOR XML (SAX)Riza Nurman
 
XML - Chapter 5 XML DOM
XML - Chapter 5 XML DOMXML - Chapter 5 XML DOM
XML - Chapter 5 XML DOMRiza Nurman
 
DBA BAB 5 - Keamanan Database
DBA BAB 5 - Keamanan DatabaseDBA BAB 5 - Keamanan Database
DBA BAB 5 - Keamanan DatabaseRiza Nurman
 
DBA BAB 4 - Recovery Data
DBA BAB 4 - Recovery DataDBA BAB 4 - Recovery Data
DBA BAB 4 - Recovery DataRiza Nurman
 
DBA BAB 3 - Manage Database
DBA BAB 3 - Manage DatabaseDBA BAB 3 - Manage Database
DBA BAB 3 - Manage DatabaseRiza Nurman
 
DBA BAB 2 - INSTALASI DAN UPGRADE SQL SERVER 2005
DBA BAB 2 - INSTALASI DAN UPGRADE SQL SERVER 2005DBA BAB 2 - INSTALASI DAN UPGRADE SQL SERVER 2005
DBA BAB 2 - INSTALASI DAN UPGRADE SQL SERVER 2005Riza Nurman
 
DBA BAB 1 - Pengenalan Database Administrator
DBA BAB 1 - Pengenalan Database AdministratorDBA BAB 1 - Pengenalan Database Administrator
DBA BAB 1 - Pengenalan Database AdministratorRiza Nurman
 
RMN - XML Source Code
RMN -  XML Source CodeRMN -  XML Source Code
RMN - XML Source CodeRiza Nurman
 
ADP - Chapter 5 Exploring JavaServer Pages Technology
ADP - Chapter 5 Exploring JavaServer Pages TechnologyADP - Chapter 5 Exploring JavaServer Pages Technology
ADP - Chapter 5 Exploring JavaServer Pages TechnologyRiza Nurman
 

More from Riza Nurman (20)

TOT PHP DAY 1
TOT PHP DAY 1TOT PHP DAY 1
TOT PHP DAY 1
 
SE - Chapter 9 Pemeliharaan Perangkat Lunak
SE - Chapter 9 Pemeliharaan Perangkat LunakSE - Chapter 9 Pemeliharaan Perangkat Lunak
SE - Chapter 9 Pemeliharaan Perangkat Lunak
 
SE - Chapter 8 Strategi Pengujian Perangkat Lunak
SE - Chapter 8 Strategi Pengujian Perangkat LunakSE - Chapter 8 Strategi Pengujian Perangkat Lunak
SE - Chapter 8 Strategi Pengujian Perangkat Lunak
 
SE - Chapter 7 Teknik Pengujian Perangkat Lunak
SE - Chapter 7 Teknik Pengujian Perangkat LunakSE - Chapter 7 Teknik Pengujian Perangkat Lunak
SE - Chapter 7 Teknik Pengujian Perangkat Lunak
 
SE - Chapter 6 Tim dan Kualitas Perangkat Lunak
SE - Chapter 6 Tim dan Kualitas Perangkat LunakSE - Chapter 6 Tim dan Kualitas Perangkat Lunak
SE - Chapter 6 Tim dan Kualitas Perangkat Lunak
 
XML - Chapter 8 WEB SERVICES
XML - Chapter 8 WEB SERVICESXML - Chapter 8 WEB SERVICES
XML - Chapter 8 WEB SERVICES
 
XML - Chapter 7 XML DAN DATABASE
XML - Chapter 7 XML DAN DATABASEXML - Chapter 7 XML DAN DATABASE
XML - Chapter 7 XML DAN DATABASE
 
XML - Chapter 6 SIMPLE API FOR XML (SAX)
XML - Chapter 6 SIMPLE API FOR XML (SAX)XML - Chapter 6 SIMPLE API FOR XML (SAX)
XML - Chapter 6 SIMPLE API FOR XML (SAX)
 
XML - Chapter 5 XML DOM
XML - Chapter 5 XML DOMXML - Chapter 5 XML DOM
XML - Chapter 5 XML DOM
 
DBA BAB 5 - Keamanan Database
DBA BAB 5 - Keamanan DatabaseDBA BAB 5 - Keamanan Database
DBA BAB 5 - Keamanan Database
 
DBA BAB 4 - Recovery Data
DBA BAB 4 - Recovery DataDBA BAB 4 - Recovery Data
DBA BAB 4 - Recovery Data
 
DBA BAB 3 - Manage Database
DBA BAB 3 - Manage DatabaseDBA BAB 3 - Manage Database
DBA BAB 3 - Manage Database
 
DBA BAB 2 - INSTALASI DAN UPGRADE SQL SERVER 2005
DBA BAB 2 - INSTALASI DAN UPGRADE SQL SERVER 2005DBA BAB 2 - INSTALASI DAN UPGRADE SQL SERVER 2005
DBA BAB 2 - INSTALASI DAN UPGRADE SQL SERVER 2005
 
DBA BAB 1 - Pengenalan Database Administrator
DBA BAB 1 - Pengenalan Database AdministratorDBA BAB 1 - Pengenalan Database Administrator
DBA BAB 1 - Pengenalan Database Administrator
 
RMN - XML Source Code
RMN -  XML Source CodeRMN -  XML Source Code
RMN - XML Source Code
 
XML - Chapter 4
XML - Chapter 4XML - Chapter 4
XML - Chapter 4
 
XML - Chapter 3
XML - Chapter 3XML - Chapter 3
XML - Chapter 3
 
XML - Chapter 2
XML - Chapter 2XML - Chapter 2
XML - Chapter 2
 
XML - Chapter 1
XML - Chapter 1XML - Chapter 1
XML - Chapter 1
 
ADP - Chapter 5 Exploring JavaServer Pages Technology
ADP - Chapter 5 Exploring JavaServer Pages TechnologyADP - Chapter 5 Exploring JavaServer Pages Technology
ADP - Chapter 5 Exploring JavaServer Pages Technology
 

Recently uploaded

भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 
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
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxUnboundStockton
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonJericReyAuditor
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 

Recently uploaded (20)

Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 
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...
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docx
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lesson
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 

Exploring the Java Servlet Technology

  • 1. Riza Muhammad Nurman 4SC Click to edit Master title style Chapter 2 on 4SC Q7M2 Chapter 2 on 4SC Q7M2 FACULTYFACULTY Riza Muhammad NurmanRiza Muhammad Nurman Exploring the java Servlet TechnologyExploring the java Servlet Technology Facebook : https://facebook.com/rizamanFacebook : https://facebook.com/rizaman Twitter : https://twitter.com/rhyzoneTwitter : https://twitter.com/rhyzone SlideShare : https://slideshare.net/rizamanSlideShare : https://slideshare.net/rizaman
  • 2. Riza Muhammad Nurman 4SC Click to edit Master title styleContent • Introduce servlet • Implement servlets
  • 3. Riza Muhammad Nurman 4SC Click to edit Master title styleIntroduction to Servlets • Web  used as a medium entertainment, business, and socializing • Ex: Google website • Servlet is a Java program that runs on the server side • Servlet features: – Efficient : • Servlets provide faster response to the client requests as it is loaded only once in the Web server memory – Asynchronous support : • Servlet supports asynchronous programming that enables it to serve multiple client requests and generate responses simultaneously
  • 4. Riza Muhammad Nurman 4SC Click to edit Master title styleThe Servlet API • To create and manage servlets, various interfaces, classes, and methods are defined in the Servlet API • Classes and interafaces of the Servlet API are available in the following packages: – javax.servlet – javax.servlet.http Servlet API javax.servlet javax.servlet.http GenericServlet ServletException Servlet RequestDispatcher ServletConfig ServletRequest ServletResponse ServletContext AsyncContext HttpServlet Cookie HttpServletRequest HttpServletResponse HttpSession Packages Classes Interfaces The Servlet API Hierarchy
  • 5. Riza Muhammad Nurman 4SC Click to edit Master title styleThe javax.servlet Package Interface Description Servlet It provides the methods that all servlets must implement ServletConfig It provides information to the servlets during the servlet initialization ServletContext It provides methods, which is used by the servlets to communicate with the Web container ServletRequest It provides the client request information to the servlet ServletResponse It helps the servlet in sending the response to the client RequestDispatcher It receives a request from a client and sends it to any other resource, such as a servlet, an HTML page, or a JSP page AsyncContext It provides the methods to handle multiple client requests asynchronously
  • 6. Riza Muhammad Nurman 4SC Click to edit Master title styleThe Methods of the Servlet Interface Interface Description void init(ServletConfig config) throws ServletException It is called by the servlet container to indicate to a servlet that the servlet is being placed into service ServletConfig getServletConfig() Returns a ServletConfig object, which contains initialization and startup parameters for this servlet String getServletInfo() Returns information about the servlet, such as author, version, and copyright void service(ServletRequest request, ServletResponse response) throws ServletException, IOException It is Called by the servlet container to allow the servlet to respond to a request void destroy() Called by the servlet container to indicate to a servlet that the servlet is being taken out of service
  • 7. Riza Muhammad Nurman 4SC Click to edit Master title styleThe Methods of the ServletRequest Interface Interface Description String getParameter(String paramName) Returns a String object that specifies the value of a particular request parameter public String[] getParameterValues(String paramName) Returns an array of String objects that contains all the values of the request parameter public Enumeration getParameterNames() Returns an Enumeration object containing all the parameter names as String objects that `request contains public String getRemoteHost() Returns a String object that specifies the full-qualified name of the computer from which the request is sent public String getRemoteAddr() Returns a String object that specifies the IP address of the computer from which the request is sent
  • 8. Riza Muhammad Nurman 4SC Click to edit Master title styleThe Methods of the ServletResponse Interface Interface Description public ServletOutputStream getOutputStream() throws IOException Returns an object of the ServletOutputStream class that represents an output stream to send binary data as response public PrintWriter getWriter() throws IOException Returns an object of the PrintWriter class that the servlet uses to send character data as response public void setContentType(String type) Sets the MIME type for a servlet response. Some of the MIME types are text/lain, image/jpeg, and text/html.
  • 9. Riza Muhammad Nurman 4SC Click to edit Master title styleThe Interfaces of the javax.servlet.http Package Interface Description HttpServletRequest It extends the ServletRequest interface to represent the request information being sent to the HTTP servlets by an HTTP client HttpServletResponse It extends the ServletResponse interface and provides methods to handle response, status codes, and response headers of the servlets that communicate using HTTP HttpSession It provides mechanism that helps in identifying a client across multiple requests
  • 10. Riza Muhammad Nurman 4SC Click to edit Master title styleCode Snippet “MyServlet” 1. import javax.servlet.http.HttpServlet; 2. import javax.servlet.http.HttpServletRequest; 3. import javax.servlet.http.HttpServletResponse; 4. public class MyServlet extends HttpServlet { 5. protected void doGet(HttpServletRequest request, HttpServletResponse response) 6. throws ServletException, IOException { 7. 8. } 9. protected void doPost(HttpServletRequest request, HttpServletResponse response) 10. throws ServletException, IOException { 11. 12. } 13. } 14. }
  • 11. Riza Muhammad Nurman 4SC Click to edit Master title styleUnderstanding the Web Container • Web Container is a component of the Web server which provides the run-time environment for executing the servlets • Web container implements the Servlet APIs – Communication Support : The Web container provides communication support that a servlet can communicate with the Web server – Lifecycle Management : The Web container manages the lifecycle of the servlets. – Multithreading Support : The Web container provides multithreading support for every servlet – Declarative Security : The Web container defines the security constraints that specify that only the authorized users can access the deployed servlets – JSP Support : The Web container compiles and translates the JSP pages into the servlet class files, which are then used to process the requests of a client
  • 12. Riza Muhammad Nurman 4SC Click to edit Master title styleThe Web Container Architecture
  • 13. Riza Muhammad Nurman 4SC Click to edit Master title styleThe Web Container Architecture - 2
  • 14. Riza Muhammad Nurman 4SC Click to edit Master title styleThe Web Container Architecture - 3
  • 15. Riza Muhammad Nurman 4SC Click to edit Master title styleThe Web Container Architecture - 4
  • 16. Riza Muhammad Nurman 4SC Click to edit Master title styleThe Web Container Architecture - 5
  • 17. Riza Muhammad Nurman 4SC Click to edit Master title styleLife Cycle of a Servlet • init() – The method is called during initialization phase of the servlet life cycle • service() – To process client request • destroy() – The method marks the end of the life cycle of a servlet public void init(ServletConfig config) throws ServletException { ... } protected void service(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { ... } public void destroy() { ... }
  • 18. Riza Muhammad Nurman 4SC Click to edit Master title styleImplementing Servlets – Create a New project Pilih kategori Java Web Pilih Projects Web Application
  • 19. Riza Muhammad Nurman 4SC Click to edit Master title styleWeb Application Structure • The root directory – Contains static resources : HTML files, JSP files, and image files • The WEB-INF directory inside the root directory – Contains the application deployment descriptor file, web.xml, which stores various configurations of a Web application • The classes directory – Contains the class files of the application • The lib directory – Contains Java Archive (JAR) files of libraries
  • 20. Riza Muhammad Nurman 4SC Click to edit Master title styleindex.html 1. <!DOCTYPE html> 2. <!-- 3. To change this license header, choose License Headers in Project Properties. 4. To change this template file, choose Tools | Templates 5. and open the template in the editor. 6. --> 7. <html> 8. <head> 9. <title>TODO supply a title</title> 10. <meta charset="UTF-8"> 11. <meta name="viewport" content="width=device-width, initial-scale=1.0"> 12. </head> 13. <body> 14. <div>TODO write content</div> 15. </body> 16. </html>
  • 21. Riza Muhammad Nurman 4SC Click to edit Master title styleCreating a Servlet • Packages : myservlet • Servlet Name : CurrentData
  • 22. Riza Muhammad Nurman 4SC Click to edit Master title styleConfiguring a Servlet Using DD File 1. <?xml version="1.0" encoding="UTF-8"?> 2. <web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema- instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"> 3. <servlet> 4. <servlet-name>CurrentDate</servlet-name> 5. <servlet-class>myservlet.CurrentDate</servlet-class> 6. </servlet> 7. <servlet-mapping> 8. <servlet-name>CurrentDate</servlet-name> 9. <url-pattern>/CurrentDate</url-pattern> 10. </servlet-mapping> 11. <session-config> 12. <session-timeout> 13. 30 14. </session-timeout> 15. </session-config> 16. </web-app>
  • 23. Riza Muhammad Nurman 4SC Click to edit Master title styleConfiguring a Servlet Using Annotations 1. @WebServlet(name = "CurrentDate", urlPatterns = {"/CurrentDate"}) 2. public class CurrentDate extends HttpServlet { 3. … 4. }
  • 24. Riza Muhammad Nurman 4SC Click to edit Master title styleServlet CurrentDate
  • 25. Riza Muhammad Nurman 4SC Click to edit Master title styleprocessRequest Method 1. protected void processRequest(HttpServletRequest request, HttpServletResponse response) 2. throws ServletException, IOException { 3. response.setContentType("text/html;charset=UTF-8"); 4. try (PrintWriter out = response.getWriter()) { 5. /* TODO output your page here. You may use following sample code. */ 6. out.println("<!DOCTYPE html>"); 7. out.println("<html>"); 8. out.println("<head>"); 9. out.println("<title>Servlet CurrentDate</title>"); 10. out.println("</head>"); 11. out.println("<body>"); 12. out.println("<h1>Servlet CurrentDate at " + request.getContextPath() + "</h1>"); 13. out.println("</body>"); 14. out.println("</html>"); 15. } 16. }
  • 26. Riza Muhammad Nurman 4SC Click to edit Master title styleOthers Method 1. @Override 2. protected void doGet(HttpServletRequest request, HttpServletResponse response) 3. throws ServletException, IOException { 4. processRequest(request, response); 5. } 6. @Override 7. protected void doPost(HttpServletRequest request, HttpServletResponse response) 8. throws ServletException, IOException { 9. processRequest(request, response); 10. } 11. @Override 12. public String getServletInfo() { 13. return "Short description"; 14. }
  • 27. Riza Muhammad Nurman 4SC Click to edit Master title styleSample 1. protected void processRequest(HttpServletRequest request, HttpServletResponse response) 2. throws ServletException, IOException { 3. response.setContentType("text/html;charset=UTF-8"); 4. try (PrintWriter out = response.getWriter()) { 5. /* TODO output your page here. You may use following sample code. */ 6. out.println("<!DOCTYPE html>"); 7. out.println("<html>"); 8. out.println("<head>"); 9. out.println("<title>Hello World</title>"); 10. out.println("</head>"); 11. out.println("<body>"); 12. out.println("<h1>"+ new java.util.Date() +"</h1>"); 13. out.println("</body>"); 14. out.println("</html>"); 15. } 16. }
  • 28. Riza Muhammad Nurman 4SC Click to edit Master title style