In the article, the ShoppingServlet is the controller in the sense that you
advocate.  All posts are sent through it.

-----Original Message-----
From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 06, 2000 3:13 PM
To: [EMAIL PROTECTED]
Subject: Re: Model 2 questions


Ginny Peterson wrote:

> We plan to use the Model 2 architecture to develop our applications, as
> described in Govind Seshadri's article "Understanding JSP Model 2
> Architecture"
> (http://www.javaworld.com/javaworld/jw-12-1999/jw-12-ssj-jspmvc.html).  I
> have a couple of questions about Model 2:
>
> Should the application's main URI invoke the controller servlet or the
> JSP?  The diagram in the article implies that the controller should
receive
> the initial request, but the sample from the article uses a JSP as the
> entry point to the app.
>

There are differences of opinion on this topic.

The article uses a JSP page as the "controller" component in this
architecture, as
does the sample application included with the Java2 Enterprise Edition
(J2EE)
SDK.  However, I have contended for a long time that a servlet is the
appropriate
technology to use for this, and have published numerous descriptions of the
approach I take (and the reasons for it) in the JSP-INTEREST and
SERVLET-INTEREST
mailing lists.  Check the archives for much more about it.

>
> Should we use a single controller servlet per application, or one per
major
> function within an application (e.g., a login controller, a search
controller)?
>

I have found it most convenient to use a single servlet per web application,
and
have it dynamically load and execute Action classes based on the request
URI.  I
have a generic utility servlet that does all this kind of basic stuff for
me, or I
can subclass it to provide application-specific functionality if necessary.

>
> Thanks in advance for any advice you can offer.
>
> Ginny
>

Craig McClanahan

===========================================================================
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