I, too, am very interested in discussing these issues.  I hope my response
earlier didn't sound argumentative -- I was just trying to explain my
thoughts and concerns.        I'd like to explain further my thoughts on the
matter:

Using the wrapper scheme, you pointed out that every JSP needs to be
referenced through the wrapper JSP, and that this extra work is at least as
much effort as the include scheme (and potentially more error-prone).  I
agree!  However, I had an idea for implementing the wrapper scheme that I
thought would alleviate this issue.  It turns out my idea doesn't quite
work, but it's worth explaining.

Because our application uses a Model 2 architecture, all JSPs are invoked by
a controller servlet after the action classes have done their work (i.e.,
the JSP to invoke is passed into the controller servlet as a parameter).
Using this architecture, I planned on having the controller servlet send all
JSP pages through the wrapper JSP.  Thus, the controller servlet would hide
all external knowledge of the wrapper JSP.

My idea works great for JSPs that are invoked as a result of servlet
processing.  However, it doesn't do anything for JSPs that are invoked
directly from an existing JSP (or even a regular HTML page).  I certainly
don't want to make the restriction that all JSPs must go through the
controller servlet, so that idea is out the window.  Oh well.

For now, I am going with the include scheme.  I don't see any way around it.
However, I am not happy with this solution and will be looking for a better
one.  Extending the JSP page is still a possibility, as this hides almost
all of the complexity.  However, I am still wary of the downsides of
extending a JSP page.

I also haven't given up on the wrapper scheme quite yet.  If I could figure
out how to get all JSPs to pass through a wrapper / controller JSP first (or
even a regular servlet), I think that would work well.  Can anyone think of
a way to do this via configuration of the servlet engine?

For instance, my servlet engine (JRun) currently maps all URLs matching
"*.jsp" to its JSP handlng servlet (JSPServlet).  If I could change this to
route through my own servlet first and then to JRun's JSPServlet, that would
solve my problem.  I actually think I might be able to do this with JRun,
but I don't want to do anything that ties me to JRun specifically.  Has
anyone done something like this before?

If I could get the wrapper solution above working, it would not require
engineers or designers to add anything to their JSPs.  Thus, it would be a
very clean solution with little chance for error.  I would like that!

--
Stephen A. Williams
HNC Telecommunications Solutions


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

Reply via email to