Calling protected doGet() method of Tomcat DefaultServlet

F

F. H.

I would like one of my servlet's doGet() methods to be able to pass a
request to to the doGet() method of Tomcat's
org.apache.catalina.servlets.DefaultServlet class. I want to do this
because I need to slightly extend the behavior of the default servlet.
It seems impossible to subclass the default servlet though; my
customized MyDefaultServlet class must be in the same
org.apache.catalina.servlets.* package to call the protected doGet()
method. Is it possible to extend the package to include
MyDefaultServlet without replacing it?
 
E

Erwin Moller

F. H. said:
I would like one of my servlet's doGet() methods to be able to pass a
request to to the doGet() method of Tomcat's
org.apache.catalina.servlets.DefaultServlet class. I want to do this
because I need to slightly extend the behavior of the default servlet.
It seems impossible to subclass the default servlet though; my
customized MyDefaultServlet class must be in the same
org.apache.catalina.servlets.* package to call the protected doGet()
method. Is it possible to extend the package to include
MyDefaultServlet without replacing it?

Hi F,

You can subclass HTTPServlet, isn't that enough to override the doGet() and
doPost()?

Regards,
Erwin Moller
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top