tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <david_jen...@yahoo.com>
Subject Re: Can jsp-file be a JspServlet init-param?
Date Sat, 11 Sep 2010 06:20:33 GMT

On Sep 8, 2010, at 11:48 PM, Mark Thomas wrote:

> On 09/09/2010 00:54, David Jencks wrote:
>> I've recently rewritten the geronimo-jetty integration to work off the servlet 3
*Registration classes.  This works great except for servlets backed by jsp files, since there's
no way to tell the servlet container through the ServletRegistration interface that its actually
something with this extra jsp file name that needs to be added through some special process
into the request.
> 
> That looks like an oversight in the 3.0 spec.

I'm not sure why you think that.  A servlet extension mechanism such as a jsp engine can use
the  servlet 3 API to add servlets directly.  I think it would make more sense to completely
remove any mention of jsp from web.xml and the servlet spec and run jsps off a separate configuration
file.

> 
>> However, its easy to subclass the JspServlet so it gets the jsp file value from an
init param, and of course its easy to set the init param from the web.xml.  This appears to
work fine.
>> 
>> Is there some reason I've missed that this is a bad idea?
> 
> Well, it would be container specific rather than defined by the spec but
> since the spec offers no way to define it, I don't see there is a choice.

The existing way of using a servlet request attribute to feed the jsp file to the instance
of the jsp servlet set up for a particular servlet element is also not mentioned in the spec.
 It does need some special attention on each request.  My proposal moves all the jsp-aware
code in catalina to the deploy phase and allows treating these explicitly set up JspServlet
instances just like any other servlet.

> 
>> If not, would the jasper community consider a patch to modify the JspServlet so it
directly looks for such an init-param?
> 
> Patches always get considered.

excellent, see https://issues.apache.org/bugzilla/show_bug.cgi?id=49916

If I've understood the tomcat build this passes all the tests and also appears to cause no
tck problems in the geronimo-tomcat integration.
> 
>> And would the tomcat community consider simplifying the runtime code to use this
init-param instead of a Constants.JSP_FILE request attribute?
> 
> As usual, it would depend on the patch.

thanks!
david jencks

> 
> Mark
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message