In general, you can consider JSPs the easy way to make a servlet.
Basically, it becomes a matter of location of files.



The way I suggest doing it (and we do on our projects) is to have all of the
'GUI'(or html) portions of the JSP in a separate location.  We have our top
level 'logic' jsp's in the root directories, and when it comes time to
actually display the GUI, we do a jsp (or pageContext) include of the GUI
file.

example: 

/myForm.jsp (sets up cookies, gathers query string params, does some logic) 
/GUI/myForm_en.jsp (display the form elements in English) 
/GUI/myForm_sp.jsp (display the form elements in Spanish) 

/myFormProcess.jsp (collect information and do logic (no GUI include) 

This allows us to still have the ease of jsp coding, recompiling, and
distribution and keep the non-GUI (or controller/view) portions of the
application separated from the GUI portions.  Another aspect of this is that
our html/GUI engineers have access to the form collection and logic portions
of the JSP, if they need it.  An example of why they might need it is if
they change the name of an element and then they have to change the
processing page for that form.  Any business logic and hard-core processing
is done in java classes or java beans used by the JSP, which GUI programmers
have limited access to.

We disallow access to GUI from outside (we use Apache to do this). 
And the difference between GUI files and non-GUI files are specified by
naming convention (directory AND file names). 

I hope this helps. 

Tony Wilson 



-----Original Message-----
From: Fyffe Carl
To: Orion-Interest
Sent: 1/5/01 12:07 AM
Subject: JSP vs Servlet

I went to jollem.com and read the CMP Primer.  Good read.  But it got me
thinking about a topic that concerns most people that are in large
development groups.  Seperation of code and html.  Proper MVC calls for
the
code to be in the controller while there is little code in the view
portion
of the application.  This allows the designers to design and the coders
to
code.

Were the rules broken for convience or has a new methodology taken over?
It
seems to me that the CMP Primer would have been easier to read and
understand if MVC had been used.

This one short coming can easily overlooked to find a gem of an article.
Are there other primers of jollem.com's caliber?  What are some useful
URL's
that you guys used to get started.

--Carl


Reply via email to