JavaEEWebWebApplicationTech.ofJavaEENukopen!PDF-XChange!PDF-XChangeWebWebServletJSPJSFTagMVCWebNukopen!PDF-XChange!PDF-XChangeWhat’stheWeb?TheWorldWideWeb()isaninformationspaceinwhichtheitemsofinterest,referredtoasresources,areidentifiedbyglobalidentifierscalledUniformResourceIdentifiers(URI).---ReferencedfromW3CWeb–HTML(HyperTextMarkupLanguage)&XML(eXtendedMarkupLanguage)Web–HTTP/HTTPS(HyperTextTransferProtocol)Web–URI(UniformResourceIndentification)WebNukopen!PDF-XChange!PDF-XChangeWhat’stheWeb?HTTP/HTTPSNukopen!PDF-XChange!PDF-XChangeHTTP/HTTPS–Request/ResponseHTTPClient/ServerCommunicationRequest=(||)CRLF[]=URLHTTP=GET|HEAD|POST|URL=++HTTPPOSTResponse=(||)CRLF[]=HTTPNukopen!PDF-XChange!PDF-XChangeWhat’saWebApplication?Awebapplicationisadynamicextensionofaweborapplicationserver.–Presentation-oriented:Apresentation-orientedwebapplicationgeneratesinteractivewebpagescontainingvarioustypesofmarkuplanguage(HTML,XML,andsoon)anddynamiccontentinresponsetorequests.–Service-oriented:Aservice-orientedwebapplicationimplementstheendpointofawebservice.Presentation-orientedapplicationsareoftenclientsofservice-orientedwebapplications.Nukopen!PDF-XChange!PDF-XChangeTheclientsendsanHTTPrequesttothewebserver.AwebserverthatimplementsJavaServletandJavaServerPagestechnologyconvertstherequestintoanHTTPServletRequestobject.Thisobjectisdeliveredtoawebcomponent,whichcaninteractwithJavaBeanscomponentsoradatabasetogeneratedynamiccontent.ThewebcomponentcanthengenerateanHTTPServletResponseoritcanpasstherequesttoanotherwebcomponent.EventuallyawebcomponentgeneratesaHTTPServletResponseobject.ThewebserverconvertsthisobjecttoanHTTPresponseandreturnsittotheclient.Nukopen!PDF-XChange!PDF-XChangeJavaEEWeb–JavaServlet–JavaServerPages–JavaServerFaces–JavaTagsNukopen!PDF-XChange!PDF-XChangeServletServletHttpServletdoGet()doPost()HttpResponseHttpSessionNukopen!PDF-XChange!PDF-XChangeWhat’saServlet?AservletisaJavaprogramminglanguageclassthatisusedtoextendthecapabilitiesofserversthathostapplicationsaccessviaarequest-responseprogrammingmodel.Nukopen!PDF-XChange!PDF-XChangeServletNukopen!PDF-XChange!PDF-XChange*;importjavax.servlet.*;importjavax.servlet.http.*;publicclassHelloWorldextendsHttpServlet{publicvoiddoGet(HttpServletRequestrequest,HttpServletResponseresponse)throwsServletException,IOException{PrintWriterout=response.getWriter();out.println(HelloWorld);}}Nukopen!PDF-XChange!PDF-XChangeHttpServletServlet–init()servlet–destroy()javaservlet–doGet()HTTPGET–doPost()HTTPPOST–getServletInfo()servletNukopen!PDF-XChange!PDF-XChange()()doPostdoPost()()Nukopen!PDF-XChange!PDF-XChange()()doPostdoPost()()–get–post–requestHttpServletRequestservletHttp–responseHttpServletResponseservlet,HttpprotectedvoiddoGet(HttpServletRequestrequest,HttpServletResponseresponse)throwsServletException,java.io.IOExceptionprotect