don't call super.doGet... On Wed, Feb 10, 2010 at 3:20 PM, Ken Bowen <kbo...@als.com> wrote: > > I feel silly, but... > Using Tomcat 6.0.20 (ordinary Apache download) with Java 1.6 on Mac OS X > 10.5.8. > > As a step towards examining what's going on in my main app, I created a > simple auxilliary servlet; here's the web.xml entry: > > <servlet> > <servlet-name>sbtester</servlet-name> > <servlet-class>com.strongbrain.tests.SBTester</servlet-class> > </servlet> > > <servlet-mapping> > <servlet-name>sbtester</servlet-name> > <url-pattern>/sbtester</url-pattern> > </servlet-mapping> > > [I also tried <url-pattern>/sbtester/*</url-pattern> with the same results > as below.] > > Here's the code for the class: > > public class SBTester extends HttpServlet { > protected void doGet(HttpServletRequest req, HttpServletResponse resp) > throws ServletException, IOException { > super.doGet(req, resp); > String qq = req.getQueryString(); > System.out.println("SBTester.doGet: query="+req.getQueryString()); > PrintWriter pw = resp.getWriter(); > pw.println("Got: "+qq); > pw.close(); > } > > When I direct my browser to http://localhost:8080/sbtester?foo=bar > [ or to http://localhost:8080/sbtester ] I get this response: > > --HTTP Status 405 - HTTP method GET is not supported by this URL > --message HTTP method GET is not supported by this URL > --description The specified HTTP method is not allowed for the requested > resource (HTTP method GET is not supported by this URL). > > But what is strange is that in catalina.out, I get: > > SBTester.doGet: query=foo=bar > > So, I'm a little confused. > A) How is this happening (doGet running, but the browser reporting an > error) > B) What am I doing wrong? > > Thanks in advance, > Ken
-- Kris Schneider --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org