Содержание
- 2. CLIENT-SERVER Client Server Protocol
- 3. CLIENT-SERVER Protocol is HTTP Client sends HTTP request Server generates HTTP response Data are returned as
- 4. HTTP Hypertext transfer protocol Resources are identified by URI or URL Command consists of header and
- 5. HTTP REQUEST
- 6. HTTP REQUEST
- 7. HTTP REQUEST
- 8. HTTP RESPONSE
- 9. HTTP RESPONSE My First Heading My first paragraph.
- 10. WEB SERVER Apache Tomcat Jetty GlassFish WebLogic WebSphere WildFly
- 11. WEB SERVER
- 12. HTML
- 13. WEB SERVER Java servlets Java server pages(JSP) Web sockets
- 14. JAVA SERVLET Java component that runs inside web server Web server loads and destroys servlets Receives
- 15. JAVA SERVLET
- 16. SERVLET CONTAINER Interacts with Java servlets Manages lifecycle of the servlet Maps URL to particular servlets
- 17. APACHE TOMCAT Developed by Apache Software Foundation Includes web server(Coyote), servlet container(Catalina) and JSP engine(Jasper) Requires
- 18. JSP Adds dynamic content to web pages Designed in 1999 Introduced JSTL(JSP standard tag library) Introduced
- 19. JSP
- 20. JSP Client sends HTTP request to the server Server recognized HTTP request and forwards to to
- 21. SAMPLE JSP Dynamic HTML Hello World!
- 22. SAMPLE JSP out.println(" Your IP address is " + request.getRemoteAddr()); String userAgent = request.getHeader("user-agent"); out.println(“ ”
- 23. JAVA BEANS Plain Java objects No-argument public constructors Setter and getter for each field May receive
- 24. JAVA BEANS public class Product implements Serializable { private int id; public Product() {} public int
- 25. JSP ARCHITECTURE
- 26. MVC
- 27. MVC Model contains application data and business rules View contains representation of the data Controller sends
- 28. JSP ARCHITECTURE
- 29. JSP VARIABLES application config out pageContext request response session
- 30. HTTPSERVLETREQUEST String getParameter(String name) Enumeration getParameterNames() String[] getParameterValues(String name) String getServerName() String getRemoteAddr() String getHeader(String name);
- 31. HTTPSERVLETRESPONSE encodeURL(String) sendRedirect(String) getHeader(String) getContentType() getOutputStream() getCharacterEncoding()
- 32. HTTP SESSION Provides way to identify a user who requests web server Identifies user Has time
- 33. HTTPSESSION getAttribute(String) getId() getServletContext() invalidate() removeAttribute(String) setAttribute(String, Object)
- 34. DIRECTIVES Provides web server with information it needs to handle JSP request Executes before compilation page
- 35. PAGE DIRECTIVE
- 36. INCLUDE DIRECTIVE
- 37. ACTIONS Executing while processing HTTP request forward include param useBean getProperty text setProperty
- 38. FORWARD ACTION
- 39. INCLUDE ACTION
- 40. USEBEAN ACTION class=“org.hillel.it.service.ServiceImpl“ /> Product product = service.getProduct(id) %>
- 42. Скачать презентацию