Bill, Bill Barker wrote: > <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > >>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. :) 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: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]