AndreaNobili
AndreaNobili

Reputation: 42957

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?

Upvotes: 5

Views: 3386

Answers (2)

suatCoskun
suatCoskun

Reputation: 912

In Eclipse you can debug JSP and it has nothing to do with server-side and client-side technologies. It doesnt work in Intellij in some cases depending on the type of project i.e. you can debug war and cannot debug jar in Intellij whereas it is possible in Eclipse

Upvotes: 0

Roman C
Roman C

Reputation: 1

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.

Upvotes: 2

Related Questions