Building Web Applications with JSP: Customizing Responses with Servlets

Java    |    Intermediate
  • 10 videos | 1h 20m 48s
  • Includes Assessment
  • Earns a Badge
Rating 4.4 of 24 users Rating 4.4 of 24 users (24)
Java servlets are server-side programs that manage clients' requests and return a customized response for each of them. Use this course to gain some hands-on experience in customizing responses in your web application with HttpServlets. Discover how to build simple web pages that accept user input in a form, develop a servlet that can process the inputs, and add complexity to your app by introducing multiple pages. This course will also help you examine the use of a RequestDispatcher and the ServletConfig and ServletContext classes and recognize how attributes are stored at different scopes in a JSP app. Having completed this course, you'll be able to use servlets to process requests and produce customized responses in a JSP application.


  • Discover the key concepts covered in this course
    Define a servlet class to process a simple get request
    Recognize the power of the webservlet annotation when it comes to mapping servlets to url endpoints
    Use an httpservletrequest object to access the parameters submitted by an end-user of a web application
    Forward a request to a different endpoint in an application using the requestdispatcher
  • Transfer processed data from a servlet to a jsp file for display in a web app
    Recognize the power and scope of the servletconfig and servletcontext classes when working with servlets
    Set attributes at the request, session, and application-level using the corresponding setter methods
    Describe the process of retrieving attributes from various scopes in your app, and recognize the limitations of each scope
    Summarize the key concepts covered in this course


  • 2m 19s
    Here, you’ll learn more about your instructor and this course. This course provides hands-on experience with customizing responses in your web application by means of HTTP servlets. You’ll learn to build a simple web page to accept user input in a form. Then, you’ll develop a servlet which can process the input supplied. You'll add complexity to your app by introducing multiple pages. FREE ACCESS
  • 12m 19s
    Here, you’ll learn about servlets. A servlet, in a Java application, is a component that can handle an incoming HTTP request, process that request, generate a response, and then send that response back to the client, via the webserver. JSP applications are converted to servlets when deployed to Tomcat. Now, you’ll make use of servlets directly. This allows you to harness their full potential. FREE ACCESS
  • Locked
    3.  Deploying and Testing a Servlet
    7m 54s
    In this demo, you’ll package your application and deploy it to Tomcat. You’ll head to index.jsp where you’ll confirm that your hyperlink points to the my-servlet URL. This is mapped to the MyServlet class. You’ll then pull up the Terminal. You’ll generate the WAR file for your app by running the mvn clean package. Once the WAR file has been generated, you’ll copy it and drop it into the webapps folder of Tomcat. FREE ACCESS
  • Locked
    4.  Processing Inputs in a Servlet
    8m 50s
    Here, you’ll watch a demo on coding your servlet. You’ll start by importing IOException and PrintWriter from You’ll use the WebServlet annotation, which can be obtained from jakarta.servlet.annotation. You’ll now learn to process inputs in a servlet. FREE ACCESS
  • Locked
    5.  Using the RequestDispatcher
    10m 9s
    In this demo, you’ll make use of a RequestDispatcher to partially process an incoming request in one servlet and then dispatch it to another servlet where more processing can be performed. While doing so, you’ll explore how the web.xml file can be used to map servlets to URL endpoints, and how these are analogous to a WebServlet annotation. FREE ACCESS
  • Locked
    6.  Forwarding a Request from a Servlet to a JSP Page
    9m 12s
    In this demo, you’ll learn to forward a request from a servlet to a JSP page. You’ll change the application so that it uses the WebServlet annotation instead of the web.xml. You’ll need to head back over to the IDE and include a new import. You'll add in the WebServlet annotation and apply it to your servlet. You’ll add in the annotation just before the class definition and then set its urlPatterns property to "/bookinfo". FREE ACCESS
  • Locked
    7.  Working with ServletConfig and ServletContext
    9m 18s
    In this demo, you’ll take a look at the ServletConfig and ServletContext objects available to HttpServlets. These are both useful when accessing servlet specific information. There’s a clear distinction between the two. A ServletConfig is servlet-specific, whereas the ServletContext has to do with the application as a whole. You’ll see how these can be accessed. You’ll also look at some of their properties. FREE ACCESS
  • Locked
    8.  Setting Attributes at Different Scopes
    11m 7s
    In this demo, you’ll explore how to set attributes at various levels or various scopes within a JSP application. You’ll create and modify several files. Each of these files represents a different stage in a user's interaction with your website. You’ll go over each of these files in sequence, starting with index.jsp. This is defined within the webapp folder. This is where you’ll simulate a user sign-in form. FREE ACCESS
  • Locked
    9.  Retrieving Attributes from Different Scopes
    7m 35s
    In this demo, you’ll retrieve attributes from different scopes. Onscreen, you’ll see this demo looks similar to the last. You’ll once again invoke getAttribute from the request level. Then, you’ll use the ServletContext when you call request.getServletContext. There’s a difference here, though. The original request object is no longer accessible since it has already been processed and has generated a response on the signinconfirm page. FREE ACCESS
  • Locked
    10.  Course Summary
    2m 4s
    In this video, you’ll summarize what you’ve learned in this course. You’ve gained hands-on experience with Customizing Responses in your web application by means of HTTP Servlets. You saw how information can be extracted from request objects and then processed either within a servlet or over multiple servlets and JSPs. You built a simple web page to accept user input in a form and then developed a servlet that could process the input supplied. FREE ACCESS


Skillsoft is providing you the opportunity to earn a digital badge upon successful completion on some of our courses, which can be shared on any social network or business platform.

Digital badges are yours to keep, forever.