on 09-23-2006 10:32 PM
Hello,
Something has happened in my NWDS so that I can no longer inspect or watch variables in debug mode. I can set a breakpoint and right-click on a variable and choose watch or inspect. However, it doesn't show the value in the Expressions view.
For example, Given this code snippet...
public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
MYLoginForm loginForm = (MyLoginForm)form;
String login = loginForm.getLogin();
String password = loginForm.getPassword();
After I step over the login= and password= lines I choose inspect on login variable. Instead of showing me the value of login I see this:
"login"=(No explicit return value)
If I hover over the login variable in the debug pane I see the value of the login.
What would have caused this and how do I fix it?
Thanks in advance for any help.
David.
Perhaps the debug perspective configuratio has been changed.
Try to reset the perspective and see if it helps.
I am not in front of the NWDS now but if I remember correctly, while you are on the debug perspective go to Window->perspective->reset perspective.
Hope it helps,
Roy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Suresh,
Thanks for replying. The link you gave me doesn't really deal with my problem.
I know how to debug in NWDS. Been doing that for a couple of years.
My problem is that all of a sudden I can't get the "Expressions" pane to show the actual value of a variable I'm trying to inspect.
Thanks anyway.
This is really in response to the reply from "Torsten".
Torsten,
That is not the last line in my execute method. I just didn't put the rest of the code in there because it doesn't matter for the purposes of this post.
It happens in ANY class I try to debug. As I said in the original post, I can hover over the variable and see its value but when I do an "inspect" or "watch" on the variable I get the message I indicated in the "Expressions" pane.
Thanks!
Hello,
is this the last line in your execute methode:
String password = loginForm.getPassword();
?
I belive so.
When I'm belive right is this the description:
The JRE (better the Garbage collection) do not need the local attributes password and login.
In java you can create everytime al local scope. A Methodebody is also a local scope.
All attributes you create in this scope (a scope begins with '{' and ends with '}' ) will only available in this scope.
Example;
// Scope 1
{
String test = "test";
// scope 2
{
String innerscope = "test2";
}
test = innerscope; // brings a compile error
}
Sometimes when I need the attribute only for debuging tests I insert a simple dummy line after the last line.
In your case it look like this:
public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
MYLoginForm loginForm = (MyLoginForm)form;
String login = loginForm.getLogin();
String password = loginForm.getPassword();
// set here a brakpoint and you can see the value fom password
String dummy = "test";
}
Torsten
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.