Debugging JSP in Intellij 2019 Ultimate

Answered

I have successfully configured the Tomcat in debug mode in Edit configurations. The break point in the JSP works as well.

 

 

But my problem is as follows :

 

a) How to evaluate the EL expressions in evaluate window ? If that is not possible what use can we get by putting breakpoints in JSP code ?

b) Can IntelliJ show me the servlet code that is generated out of this JSP ? From this stackoverflow question , I know how to see it manually.

c) In case of any error in JSP , like the 500 one , the tomcat shows the stacktrace of the servlet code generated out of this JSP. How should I map that in JSP line in IntelliJ ?

0
3 comments

IntelliJ IDEA doesn't support it:

https://youtrack.jetbrains.com/issue/IDEA-89604
https://youtrack.jetbrains.com/issue/IDEA-169951

You can view the generated code if you add a new content root for the module that will point to a directory with the generated classes like c:\Users\<user>\.IntelliJIdea2019.1\system\tomcat\Unnamed_TomcatHotDeploy\work\Catalina\localhost\ROOT\.

Mapping work automatically in the debugger, but there is no way to open the stacktrace and map it automatically.

You can copy/paste the statement from the generated Java code to the evaluation dialog like this:

(java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${u.param}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null);

Adding all the Tomcat jars into the server library is needed for this to work properly:

0
Avatar
Permanently deleted user

Thnx for the reply. 

 

It seems to me that putting a breakpoint in JSP in IntelliJ is of not much help. I was curious if there are some scenarios where it will be helpful ? Especially for end users who don't want to delve into all that Jasper code to get things evaluated.

0

You can debug the flow control (logic conditions, loops) and other aspects of the JSPs.

0

Please sign in to leave a comment.