Although we are not using the J2EE Application Server, there are notes in the J2EE Tutorial Chapter 3 with nice diagrams of how J2EE servers are set up (local same page)
For presentation-oriented, it points the reader to the servlet chapter of the tutorial.
For service-oriented, it then points the reader to Building Web Services with JAX-RPC
and SOAP with Attachments API for Java
There are different ways to connect your servlets and JSPs.
"A web component indirectly invokes another web resource when it embeds a URL that points to another web component in content returned to a client."
ShowCartServlet.java (gets a session too).
response.encodeURL( ... )
Another alternative, if you are moving to a page that does not need the current servlet anymore, is to invoke sendRedirect on the response object and pass it the next servlets URL.
(Core Servlets (page 125) and page 9 (of 30). For example, after someone fails to log in, you might want to direct them to an application form:response.sendRedirect("http://localhost:8080/myWarDir/ApplicationForm");
For examples: See O'Reilly Course 6 Lesson 8
The page (Web App Life Cycle) in the tutorial is quite useful for linking JSPs.
This is a nice chapter - it ties a lot of things together. The Web App Life Cycle section shows code for how one servlet can tell the next one information
about the context through a RequestDispatcher . Here is another link about sharing information
and an example of its use invoking other web resources and transferring control (forward and include)
Note use of dispatcher.include(request, response); and dispatcher.forward(request, response);
To see what is happening here, Marty Hall has a nice link to some example code on his Request Forwarding snippet
For examples: See O'Reilly Course 6 Lesson 13
( which? )
The J2EE API (1.4 local)