0

I am trying to debug a java web application. The problem is due to something before the doGet/doPOST methods. Where do I start where do I look inside the container to debug before the doGet or how exactly is a request handled?

6
  • AFAIK you servlet life cycle is init -> doGet/doPost --> destroy you can see in init before getting executed doGet/doPost... Commented Apr 23, 2012 at 20:10
  • You can attach a debugger to your container and tell it to pause on error. Commented Apr 23, 2012 at 20:11
  • what do you use for developing (which IDE/editor?) Commented Apr 23, 2012 at 20:12
  • Post the problem you are facing. Commented Apr 23, 2012 at 20:13
  • The problem I think is due to stuff in the web.xml eg authentication at the container level, how can this be debugged I am using eclipse. Commented Apr 23, 2012 at 20:18

2 Answers 2

2

Here is the Servlet lift cycle.

Intit
Service(doGet/doPost)
Destroy

When servlet initialized init method calls so you can start debugging from the init method of the servlet and moves towards Service(doGet/doPost) method. see Servlet Life Cycle

Sign up to request clarification or add additional context in comments.

Comments

0

Well, the answer depends greatly on what you load before the doGet/doPost parts of your code. Do you set up code in contextListeners, if so you start there, etc...

To better debug you should enable logging to file in the servlet container (i.e. jetty, tomcat, glassfish, whatever) to see if there is any error messages there that might be the cause of your woes...

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.