table of contents
MSAJSP

Source Code Archive

More Servlets and JavaServer Pages


Chapter 4: Using and Deploying Web Applications

To view source code for other chapters in this book, mouse over the table of contents bar on the left.

Source Code from Chapter

Note: right-click or shift-click on the links to download the associated file.

  • app-blank.zip. Blank Web app to use as the starting point for your Web applications. Uses servlet 2.4 (JSP 2.0) version of web.xml.
  • HelloWebApp.jsp. Simple JSP page used to test deployment of and access to Web applications. Goes in the top level of the webapp1 directory.
  • HelloWebApp.java. Simple servlet used to test deployment of and access to Web applications. Goes in webapp1/WEB-INF/classes.
  • web.xml. Deployment descriptor for webapp1 application. Only element is welcome-file-list. Goes in webapp1/WEB-INF.
  • webapp1.war. The entire webapp1 application bundled in a WAR (Web ARchive) file.
  • AppUtils.java. A small set of utilities to simplify the use of URLs in Web applications.
  • SetSharedInfo.java. Servlet that puts some data into the session, the servlet context, and two cookies. Then redirects the user to the servlet that displays info on sessions, the servlet context, and cookies. Used in the shareTest1 Web application.
  • ShowSharedInfo.java. Servlet that summarizes information on sessions, the servlet context and cookies. Illustrates that sessions and the servlet context are separate for each Web app but that cookies are shared as long as their path is set appropriately. Requires the ServletUtilities class from Chapter 2.
  • web.xml. Deployment descriptor for shareTest1 Web application. Only element is welcome-file-list.
  • shareTest1.war. The entire shareTest1 application bundled in a WAR (Web ARchive) file.

URLs Referenced in Chapter

More Information

Java

JSF (JavaServer Faces)

Servlets & JSP
Ajax, GWT, & JavaScript

Spring, Hibernate, & JPA

Struts