I've been doing something similar. If you right a stateless bean to act as a
"controller" bean, and then call this at the top of the page, then you can write
business and control logic in this bean - it acts like a dispatcher for the
request coming in, almost like calling a servlet first ala Model 2.
It also means that if there are any beans you want to use in the processing of the
request, then you can "cheat" and use the jsp engine to set their properties like:
<jsp:useBean id="template" scope="page" class=etc >
<jsp:setProperty name="template" property="*" /> <---- cheat by using JSP :o)
</jsp:useBean>
<jsp:useBean id="vcontrol" scope="session" class=etc/>
<%
vcontrol.processRequest(request, pageContext); // do control logic
%>
// grab results out of processed request
<jsp:useBean id="results" scope="page" class=com.hyperlink.tcs.bean.Search />
There are problems of course, but it's kind of like a Model 1.5 ;) - as much code
is out of the page as possible. Also, it works with the 2.0 servlet api, which
lacks the Requestdispatcher class, and so the ability to forward requests to other
servlets in the engine.
If you're really fussy, I suppose you could put the processRequest call into a
separate jsp that you include in the page - like:
(in pseudo jsp :)
usebean - setup initial beans
<jsp:include - some file in here to perform the processRequest stuff
useBean - get results out
Bingo - only jsp syntax in the page the designers get to see.
Jari.
Scott Ganyo wrote:
> I take the Model 1 approach as well because of its relative simplicity and
> amount of work that is done for you behind the scenes. I also ensure that
> as little code as possible is placed into the .jsp pages themselves and is
> instead put into Java Beans. So far, this approach has worked very well for
> us (and is currently running a commercial ASP application on the Web).
>
> Scott
===========================================================================
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