facebook

debugging Servlets

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #252459 Reply

    javeed123
    Member

    Hello techies,
    I am very new to myeclipse. I am using EnterpriseWorkbenchInstaller_4.0.3GA_E3.1. It is very nice tool to go ahead with J2EE development.
    I had few problems in debugging the servlets in Tomcat. I had configured Tomcat 5.0 in my machine and I am able to start Tomcat from MyEclipse.
    I had placed few break points in my code at line no.s 18,19,22,26.
    Here is my code

    
    package servlet;
    
    import java.io.IOException;
    import java.io.PrintWriter;
    import java.util.Enumeration;
    
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    
    public class Test extends HttpServlet {
    
        
        public void doGet(HttpServletRequest request, HttpServletResponse response)
                throws ServletException, IOException {
    
            response.setContentType("text/html");
            PrintWriter out = response.getWriter();
            Enumeration e =request.getParameterNames();
            while(e.hasMoreElements()){
                String s=(String)e.nextElement();
                String v[]=request.getParameterValues(s);
            for(int i=0;i<v.length;i++)
            {
                out.println("value"+v[i]);
            }
        }
        }
            
            
        public void doPost(HttpServletRequest request, HttpServletResponse response)
                throws ServletException, IOException {
    
             doGet(request, response);
        }
    
    }
    

    When I am pressing F6, it is working fine upto last trace and the control is now comming to after doPost() i.e. at line no37.
    Now here the problem the control is going to HttpServlet.class and I am unable to proced further.

    Can u guys tell me xactly what is the problem, so that I can fix this issue.

    regards,
    Javeed.

    #252487

    Riyad Kalla
    Member

    Javeed,
    The debugger is tracing into the Tomcat servlet implementation classes, what I suggest doing is using “Continue” to jump between breakpoints in your file so you can *jump through* the application server classes.

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: debugging Servlets

You must be logged in to post in the forum log in