The answer to the "how is Main.jsp page executed" question is kind of interesting.

In the "Duke's Pet Store" example, check out the web application deployment
descriptor file (src/estore_war.xml).  You will see that Main.jsp is defined as a
servlet named "webTierEntryPoint", and that this servlet is mapped to the URL
pattern "/control/*".  Thus, any URL that matches this pattern invokes the Main.jsp
page to do it's thing.  The first place this happens is on the welcome page
(index.html), where the "Enter the Store" hyperlink goes to "control/main" and
therefore invokes this JSP page.

Personally, I would have used a real servlet to play the "controller" role here,
because the Main.jsp is simply used as a dispatcher to the appropriate request
processing logic followed by a forward to the correct page to display the results.
But the basic concept still works even with a JSP page.

Craig McClanahan



Bomberry Bill wrote:

> I am sending this one last time in the hopes that someone new to the group
> has reviewed the J2EE Application Programming Model.
>
> FYI - Chapter 6 of the APM for J2EE has recommendations on the use of JSP
> with Servlets.
>
> Regards,
> Bill Bomberry
>
> > -----Original Message-----
> > From: Bill Bomberry [SMTP:[EMAIL PROTECTED]]
> > Sent: Wednesday, December 08, 1999 11:09 AM
> > To:   [EMAIL PROTECTED]
> > Subject:      J2EE Application Programming Model and JSP
> >
> > Good morning! I have been reviewing the J2EE Application Programming
> > Model. I have a quick question related to JSP's.
> >
> > The documentation for the J2EE APM as well as the code indicate that the
> > main.jsp is used to process all HTTP requests. Main.jsp in turn invokes
> > the processRequest(HttpServletRequest req) method of the GUIController
> > class.
> >
> > The only reference that I see to the main.jsp on for instance the
> > Shopping Cart Screen (cart.jsp) is that cart.jsp includes banner.jsp
> > which includes a home_banner.jsp. The home_banner,jsp has a hypertext
> > link associated with the logo image for the application.  I do not see
> > how the  main.jsp and hence processRequest(HttpServletRequest req)
> > method of the GUIController class is being invoked for every HTTP
> > request.
> >
> > If somebody has reviewed the J2EE APM and can enlighten me it would be
> > greatly appreciated! I have reviewed the J2EE Application Programming
> > Model Version 1.0 documentation as well as the Java Server Specification
> > version 1.1. If you know the answer and it is embodied in one of these
> > documents, please refer to the relevant page from the document.
> >
> > thank you,
> > Bill Bomberry
> > Application Management Services
> > Deere & Company
> > Moline, Illinois 61265
> >
> > ==========================================================================
> > =
> > To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> > JSP-INTEREST".
> > FAQs on JSP can be found at:
> >  http://java.sun.com/products/jsp/faq.html
> >  http://www.esperanto.org.nz/jsp/jspfaq.html
>
> ===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> FAQs on JSP can be found at:
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to