This is MVC (Model View Controller) architecture.  It's purpose is to
increase separation of concerns, reusablility, and decouple your view
layer from your business logic layer.  It is considered good design to
keep all logic out of your view (JSP), and that would include navigation
and traffic logic.  There are many cases where the Controller could get
much more involved than what you described.

This will theoretically allow your java programmers to program java, and
your HTML guys to do HTML, without messing up your dynamic code.  It's
actually not that simple, but MVC helps.  There is more to it, but this
email is already getting pretty long.

If I were you, I would research MVC design patterns, and take a look at
some existing frameworks that implement it.  Some existing Frameworks
include Struts, Tapestry, WebWork, Maverick, etc.  If you love JSP, and
want a pretty simple and popular framework, look into Struts.  For a
true Object Oriented Component Object Model, built on top of an MVC
architecture, look into Tapestry.  Both are Jakarta projects.  I really
like Tapestry, but it would really help understanding the various java
design patters, as Tapestry kind of forces them a bit.

Good Luck!

On Wed, 2003-08-27 at 10:09, Manoj Kansal wrote:
> One example that I have gone across is there was a servlet. Some parameter is
> passed to servlet from JSP using request object. According to that parameter,
> servlet decide on which JSP request is to be forwarded. Then servlet uses
> requestDispatcher. This Servlet is said to be a controller servlet.
>
> Now the thing is when JSP is itself having parameter then why in the jsp, based on
> that parameter,  it is not decided what will be next JSP that is to be called.
> I could not get why servlet was used here. Any suggestions. Or anybody if has used
> can explain where they have used, so that we can analyse it.
>
> Manoj
>
>
> "Campano, Troy" wrote:
>
> > Nothing....I'm not using servlets.
> > But if I was it would just read in the request and pass it to a
> > class/method.
> >
> > Right now when I submit JSP forms, the form goes to a JSP that calls the
> > class/method and passes in the values from request.
> >
> > So I guess if you have multiple developers, interface people,
> > programmers, etc....it would make sense to use servlets because then you
> > can keep most programming code out of the JSP.
> >
> > Thanks!
> > -----Original Message-----
> > From: Manoj Kansal [mailto:[EMAIL PROTECTED]
> > Sent: Wednesday, August 27, 2003 11:55 AM
> > To: [EMAIL PROTECTED]
> > Subject: Suspected Junk Mail: Re: Why use servlets?
> >
> > Can you brief on what part is handled by your servlet. I too want to
> > clarify on
> > that.
> > Manoj
> >
> > "Campano, Troy" wrote:
> >
> > > I'm curious as to what the reason is to use Servlets.
> > > I write straight java class/methods and call them from my JSP.
> > > My business logic goes into these classes.
> > >
> > > JSP handles the interface and handles request/response.
> > > Usually I guess it's a Servlet that handles the request/response but
> > it
> > > seemed to me like an added extra step.
> > > I didn't really see what I was gaining by using a Servlet.
> > >
> > > So I'm curious of what the point of Servlets are....is there something
> > > they give you that JSP doesn't?
> > > So I know I'm missing something....why use Servlets?
> > >
> > > Thank you for your responses!
> > >
> > > ~ t r o y ~
> > >
> > > Troy Campano
> > > IAS Database Management
> > > Liberty Mutual
> > > (603) 245 4092
> > > [EMAIL PROTECTED]
> > >
> > >
> > ========================================================================
> > ===
> > > To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> > JSP-INTEREST".
> > > For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
> > DIGEST".
> > >
> > > Some relevant archives, FAQs and Forums on JSPs can be found at:
> > >
> > >  http://java.sun.com/products/jsp
> > >  http://archives.java.sun.com/jsp-interest.html
> > >  http://forums.java.sun.com
> > >  http://www.jspinsider.com
> >
> > ========================================================================
> > ===
> > To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> > JSP-INTEREST".
> > For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
> > DIGEST".
> >
> > Some relevant archives, FAQs and Forums on JSPs can be found at:
> >
> >  http://java.sun.com/products/jsp
> >  http://archives.java.sun.com/jsp-interest.html
> >  http://forums.java.sun.com
> >  http://www.jspinsider.com
> >
> > ===========================================================================
> > To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> > For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
> >
> > Some relevant archives, FAQs and Forums on JSPs can be found at:
> >
> >  http://java.sun.com/products/jsp
> >  http://archives.java.sun.com/jsp-interest.html
> >  http://forums.java.sun.com
> >  http://www.jspinsider.com
>
> ===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
>
> Some relevant archives, FAQs and Forums on JSPs can be found at:
>
>  http://java.sun.com/products/jsp
>  http://archives.java.sun.com/jsp-interest.html
>  http://forums.java.sun.com
>  http://www.jspinsider.com
--
Dan Wells <[EMAIL PROTECTED]>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".

Some relevant archives, FAQs and Forums on JSPs can be found at:

 http://java.sun.com/products/jsp
 http://archives.java.sun.com/jsp-interest.html
 http://forums.java.sun.com
 http://www.jspinsider.com

Reply via email to