Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I debug JavaScript code that is inside JSP page directly from IntelliJ IDEA?

I am working on a Java web application that implement its view using JSP.

Into this JSP I have some JavaScript functions that I want to debug. I know that I can do it using FireBug but I want know if I cand debug this JavaScript functions directly inside IntelliJ IDEA IDE.

It seems to me that I can debug the JavaScript inside HTML directly from IntelliJ (as shown here: https://www.jetbrains.com/idea/help/debugging-javascript.html).

But is it possible also for the JSP page? If it is possible how can I do it?

like image 627
AndreaNobili Avatar asked Nov 01 '22 04:11

AndreaNobili


1 Answers

No, it's impossible. JSP is a server-side technology used by web servers running Java. JavaScript is a client-side technology used by browsers. The debugger can't use both of them simultaneously, or there should be two different debugging sessions that are running in the IJ, but I'm not sure if IJ support this feature. The only option is to use Remote Debugging, that you can use to connect to the running web server. In this way you can debug HTML page generated by the server. Even if that page is a result of JSP output you can't debug JSP in this debugging session.

like image 59
Roman C Avatar answered Nov 12 '22 13:11

Roman C