This Question is Answered

1 "correct" answer available (4 pts) 2 "helpful" answers available (2 pts)
3 Replies Last post: Feb 25, 2014 3:53 AM by Tom Williamson  
Tom Williamson Newbie 21 posts since
Aug 8, 2012
Currently Being Moderated

Feb 22, 2014 2:45 AM

How do I evaluate objects when debugging a JSP?

I am a relatively experienced Java programmer and IntellJ user and I am trying something new - I need to debug a web app on Tomcat.   However, there doesn't seem to be a clear-cut guide to how to do this in Intellj (at least I can't find it.)

 

I've got the project running in debug mode, set a breakpoint inside my JSP and when I hit that page my app stops at the breakpoint.

 

My question:   How do I evaluate the values that the JSP is using?   I am breaking on a line like:

 

    <c:if test="${myObject.myThing == SomeClass.ENUMVALUE.myvalue}"  >

 

and anything I try to "watch" or "evaluate" gives me an error message.   I get either

 

${myObject.myThing == SomeClass.ENUMVALUE.myvalue}:  Invalid Expression

 

myObject.myThing:  Type is unknown for 'myObject'

 

(MyCorrectType) myObject:  Cannot find local variable 'myObject'

 

How can I evaluate these expressions and find out what's in them?   Is that even possible?

Alexander Chernikov JetBrains 1,113 posts since
Jan 11, 2007
Currently Being Moderated
Feb 23, 2014 11:55 PM in response to: Tom Williamson
Re: How do I evaluate objects when debugging a JSP?

Hello.

 

I've tried to evaluate such "predefined" object as pageContext, and it works for me.

 

Then where does myObject come from? How is it defined?

 

Regards,

Alexander.

More Like This

  • Retrieving data ...