Hi,
> I understand. One thing, however - I still was going to have the main
> "controller" servlet that was going to do the routine things - check for
> login, check for session, etc. Then *that* controller servlet was going to
> instantiate the Action servlet and call its doGet(). But as you say, that
> would be overkill since the Action servlet would carry a lot of
> unnecessary
> baggage.
>
> Am I right that your Action classes then just each extend the Action
> interface and have just the one perform() method? And the Action class is
> the one that forwards to the correct JSP page?
Yes..this is correct. However, as Craig often says..your mileage may vary in
how you implement it. Because ALL actions will forward to a JSP page, I
decided to put the forwarding call in the controller servlet itself. The
reason for me is that I can centrally locate the ability to catch any
uncaught exceptions, put them in the REQUEST object, then forward to the
right JSP page, all in one location. This means each action class does NOT
forward, and thus the reuse of the forward call (probably minor). However, I
DO allow the action class to return a String representing the jsp page to
forward to. Thus, the action class still can dictate what JSP page it
forwards to simply by returning the path and page name. This, in my opinion,
is a bit better in design (as far as I know..correct me if I am wrong),
because instead of placing any exceptions that may occur in each action, I
can catch them all in the controller servlet and do it one time (code wise)
there, and forward one time (code wise) there. I am repeating myself aren't
I? ;)
I am awaiting Craigs open-source solution to Model 2!!
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets