facebook

Request parameters value in debug mode

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

    Hello ,

    Something that I don’t understand :

    I use JSP and servlet with a Tomcat server. I use the remote debug mode to debug my application . The JSP sends some parameters to the servlet via the request object ( post or get ). I put a breakpoint in the servlet and I hope to see the value of the parameter in the request object but I cant find it !! I can’t find the parameter variable and so its value .

    If someone can explain me how find parameters value ( variable window in debug mode ) during the servlet debug ?

    Thanks

    #270792 Reply

    Riyad Kalla
    Member

    If you aren’t seeing your parameter values then chances are you are sending them wrong. You could try and just print them out with System.out.println arguments, if you get back “null” then you are likely sending them wrong to your servlet.

    #270851 Reply

    Hello,

    Thanks you, but my application works . Parameters are right sending by the JSP and received by the servlet . But I can’t find them in the request object of the Variable window .Neither the name nor the value …

    #270863 Reply

    Riyad Kalla
    Member

    I’m confused… I’m guessing at some point in your servlet you do request.getParameter to get the values out right? If you are debugging and step to that point, and then check the returned value from the getParameter call, I’m guessing it’s the legit value right?

    I would suggest necessarily digging around the request objects, server-objects tend to be really complex and layered with abstraction. Instead add some watch variables that evaluate them for the specific values you want to see.

    #271166 Reply

    It does’nt give me a suffisant debug level for a issue that I have :

    a parameter is null but seeing not null in the servlet :

    
    cat.debug("rev = "+request.getParameter(PidParam.JSP_PARAM_PROD_REV));
                        if ((request.getParameter(PidParam.JSP_PARAM_PROD_REV) != null) && (request.getParameter(PidParam.JSP_PARAM_PROD_REV) != "")) {
                            where = Tools.buildWhereString(where, "P.PROD_REV", request.getParameter(PidParam.JSP_PARAM_PROD_REV), "", "");
                          searchVO.setProd_rev(request.getParameter(PidParam.JSP_PARAM_PROD_REV));
                            searchVO.setChk_prod_rev(new String("Y"));
                        } else {
                            searchVO.setChk_prod_rev(new String("N"));
                            searchVO.setProd_rev("");
                        }
    

    the parameter PidParam.JSP_PARAM_PROD_REV is null but I enter in the if condition, not in the else !! I don’t understand why ??

    the cat.debug print give nothing !!

    #271185 Reply

    Riyad Kalla
    Member

    This is no longer a MyEclipse question, this is more of an issue of troubleshooting code. Adding a breakpoint and then stepping through this code adding a watch variable to watch the value of “request.getParameter(PidParam.JSP_PARAM_PROD_REV)” should give you all the data you need.

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: Request parameters value in debug mode

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