In my JSP file I have a property initialized like this:
<c:set var="perspectiveCount" value="0"/>
I am trying to learn how to debug JSP in NetBeans.
When I toggle a breakpoint just after that line and debug the program I get a plethora of variables in the Variables tab where I cannot find perspectiveCount
. Maybe because it's not exactly a variable, but a property.
I also tried to use Evaluate Code tab, but it answers me "perspectiveCount" is not a known variable in the current context.
What is the correct way to debug and learn the value of perspectiveCount
?
Hover over a variable to see its value. When stopped in the debugger hover the mouse cursor over the variable you want to look at. The DataTip will appear showing you the value of that variable. If the variable is an object, you can expand the object by clicking on the arrow to see the elements of that object.
Variables/Expression view – Shows the declared variables and their values. Press Ctrl+Shift+d or Ctrl+Shift+i on a selected variable or expression to show its value. You can also add a permanent watch on an expression/variable that will then be shown in the Expressions view when debugging is on.
Debug the JSPRight-click in Source view and select Debug As > Debug on Server. The process is the same as for running an application. Note that since the server was started before in non-debug mode, you will be prompted to restart the server. Click OK to restart in Debug mode.
Althought you debug with Netbeans, this might be helpful to others:
On Intellij pageContext appears and dissappears from debug as a local variable. You can relay on _jspx_page_context
then
_jspx_page_context.findAttribute("perspectiveCount")
will let you debug what you want on Intellij.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With