WDD_lec_27 - Java Servlets Lec 27 Creating a Simple Web...

Info iconThis preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon
    Java Servlets Lec 27
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
    Creating a Simple Web Application in Tomcat
Background image of page 2
    Tomcat Directory Structure myapp
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
    Tomcat Setup Folder for HTML and JSP pages Folder for servlet and other java classes
Background image of page 4
    Servlet Types Servlets are based on two main packages javax.servlet javax.servlet.http GenericServlet For writing protocol independent servlets HttpServlet Extends from GenericServlet class Adds functionality for writing HTTP specific servlets
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
    Servlet class hierarchy Object GenericServlet ServletResponse HttpServletRequest ServerRequest HttpServlet HttpServletResponse javax.servlet javax.servlet.http
Background image of page 6
    Writing Servlet Every servlet must implement the javax.servlet.Servlet interface Contains the servlet’s life cycle methods etc. These are implemented by GenericServlet and HttpServlet classes Extend your servlet from one of these classes and add your own functionality public class MyServlet extends GenericServlet public class HelloServlet extends HttpServlet
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
    Types of HTTP Requests Get Post Delete Options Put Trace
Background image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 18

WDD_lec_27 - Java Servlets Lec 27 Creating a Simple Web...

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online