- This topic has 5 replies, 2 voices, and was last updated 17 years, 8 months ago by
Riyad Kalla.
-
AuthorPosts
-
Lahellec Jean-FrancoisMemberHello ,
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
Riyad KallaMemberIf 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.
Lahellec Jean-FrancoisMemberHello,
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 …
Riyad KallaMemberI’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.
Lahellec Jean-FrancoisMemberIt 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 !!
Riyad KallaMemberThis 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.
-
AuthorPosts