You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Robert Quillen <ro...@fastforms.com> on 2000/09/25 19:41:00 UTC

RE: cvs commit: jakarta-tomcat/src/facade22/org/apache/tomcat/mod ules/facade22 JspInterceptor.java

I've been trying to get JspInterceptor to work in my copious (NOT!) amounts
of spare time.  

I want to get per-jsp init parameters working.  I've long since worked
around needing them, but the lack of support still bugs me.  I think it's a
spec conformance issue.

In preparation for testing JspInterceptor, I wanted to remove the current
jsp handling and test to make sure jsps wouldn't work.  So I commented out
where the JspServlet and it's mapping are hard coded into
WebXmlReader.setDefaults().  I also removed the relevant sections in
conf/web.xml.  (Is this still used?  It looks like those things are all hard
coded into WebXmlReader.) 

I expected these changes to break jsp handling, but it broke much more than
that.  Tomcat wouldn't even serve ROOT/index.html.  There was a NULL pointer
exception in AccessInterceptor.  Apparently adding the jsp servlet to the
context in WebXmlReader is causing some side-effect that the
AccessInterceptor (and probably others) is depending on.  This is a bug in
my opinion.  Tomcat should work without jsp support.  Not to mention that
depending on side effects in this manner is a bug anyway.

I never even got far enough to test the JspInterceptor.  :(

I'll post a patch once I get it straightened out.

-Robert Quillen


-----Original Message-----
From: costin@locus.apache.org [mailto:costin@locus.apache.org]
Sent: Monday, September 25, 2000 11:13 AM
To: jakarta-tomcat-cvs@apache.org
Subject: cvs commit:
jakarta-tomcat/src/facade22/org/apache/tomcat/modules/facade22
JspInterceptor.java


costin      00/09/25 08:12:41

  Modified:    src/facade22/org/apache/tomcat/modules/facade22
                        JspInterceptor.java
  Log:
  Fixed build - forgot JspInterceptor.
  
  BTW, what about enabling ( and fixing the remaining bugs :-) it by default
  for 3.3 ?
  It's much faster and cleaner, and will allow us to better integrate with
  Jasper 1.2. Another risk - but it may be worth it.
  
  Revision  Changes    Path
  1.2       +5 -4
jakarta-tomcat/src/facade22/org/apache/tomcat/modules/facade22/JspIntercepto
r.java
  
  Index: JspInterceptor.java
  ===================================================================
  RCS file:
/home/cvs/jakarta-tomcat/src/facade22/org/apache/tomcat/modules/facade22/Jsp
Interceptor.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- JspInterceptor.java	2000/08/23 06:53:05	1.1
  +++ JspInterceptor.java	2000/09/25 15:12:38	1.2
  @@ -601,7 +601,7 @@
   
       public HttpServletRequest getRequest() {
   	log("JspEngineContext1: getRequest " + req );
  -        return req.getFacade();
  +        return (HttpServletRequest)req.getFacade();
       }
       
   
  @@ -610,7 +610,7 @@
        */
       public HttpServletResponse getResponse() {
   	log("JspEngineContext1: getResponse " );
  -        return req.getResponse().getFacade();
  +        return (HttpServletResponse)req.getResponse().getFacade();
       }
   
       /**
  @@ -644,7 +644,7 @@
       public ServletContext getServletContext() {
   	log("JspEngineContext1: getCtx " +
   			   req.getContext().getFacade());
  -        return req.getContext().getFacade();
  +        return (ServletContext)req.getContext().getFacade();
       }
       
       /**
  @@ -803,7 +803,8 @@
       public java.io.InputStream getResourceAsStream(String res)
       {
   	log("JspEngineContext1: getRAS " + res);
  -        return req.getContext().getFacade().getResourceAsStream(res);
  +        ServletContext sctx=(ServletContext)req.getContext().getFacade();
  +	return sctx.getResourceAsStream(res);
       };
   
       /** 
  
  
  

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

Re: cvs commit: jakarta-tomcat/src/facade22/org/apache/tomcat/modules/facade22 JspInterceptor.java

Posted by co...@eng.sun.com.
Robert Quillen wrote:

> I've been trying to get JspInterceptor to work in my copious (NOT!) amounts
> of spare time.
>
> I want to get per-jsp init parameters working.  I've long since worked
> around needing them, but the lack of support still bugs me.  I think it's a
> spec conformance issue.

Hi Robert,

I haven't updated JspIntereptor, but I was able to use it for normal JSPs.
( it seemes very few people were interested in it ). It is much faster
than JspServlet, but we can't enable it without developer review and
testing.

I'll make sure it works again - all you need to do is add the interceptor
to the config file ( before StaticInterceptor).

Removing Jasper shoulnd't be a problem, I'll take a look this evening.
( BTW, I'm working on 3.3 , I don't think JspInterceptor can be
enabled in 3.2 anyway ).

Costin