tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Barker" <wbar...@wilshire.com>
Subject Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/connector CoyoteAdapter.java
Date Thu, 28 Oct 2004 19:07:22 GMT

----- Original Message -----
From: "Jan Luehe" <Jan.Luehe@Sun.COM>
To: "Tomcat Developers List" <tomcat-dev@jakarta.apache.org>
Sent: Thursday, October 28, 2004 9:45 AM
Subject: Re: cvs commit:
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/connector
CoyoteAdapter.java


> Bill,
>
> Bill Barker wrote:
> > <luehe@apache.org> wrote in message
> > news:20041027225817.54645.qmail@minotaur.apache.org...
> >
> >>luehe       2004/10/27 15:58:17
> >>
> >> +
> >> +    private Method[] getAllDeclaredMethods(Class c) {
> >> +
> >> +        if (c.equals(javax.servlet.http.HttpServlet.class)) {
> >> +            return null;
> >> +        }
> >> +
> >> +        Method[] parentMethods =
> >>getAllDeclaredMethods(c.getSuperclass());
> >
> >
> > If the servlet isn't a HttpServlet (e.g. it's a JSP page) then this will
> > recurse down to j.l.Object, when c.getSuperClass will return 'null', and
you
> > will get an NPE from the 'c.equals' line.
>
> Actually, in the case of a JSP, we're dealing w/ JspServlet, which is an
> instance of HttpServlet.
>
> I've changed the code to return a constant set of methods if the servlet
> is not an instance of HttpServlet, avoiding the NPE. :)
>

My bad.  I should pay more attention to Jasper :).

However, a JSP page still will return 'Allow: OPTIONS' after all of this
work :).

> Thanks,
>
> Jan
>
>
> > IMHO, this patch is an overly complex way to try and determine something
> > that isn't determinable under the servlet spec (again, think JSP page
:).
> > You might as well just set the Allow header to any old constant set of
> > methods.
> >
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
>



This message is intended only for the use of the person(s) listed above as the intended recipient(s),
and may contain information that is PRIVILEGED and CONFIDENTIAL.  If you are not an intended
recipient, you may not read, copy, or distribute this message or any attachment. If you received
this communication in error, please notify us immediately by e-mail and then delete all copies
of this message and any attachments.

In addition you should be aware that ordinary (unencrypted) e-mail sent through the Internet
is not secure. Do not send confidential or sensitive information, such as social security
numbers, account numbers, personal identification numbers and passwords, to us via ordinary
(unencrypted) e-mail.



Mime
View raw message