views:

49

answers:

3

Is it possibe to launch grails based java web project from within Eclipse or Netbeans IDE and setup breakpoints in both java and javascript sources and be able to debug both?

If so then how?

I understand debugging javascript is normally done using browser based debugger such as firebug for firefox but there are situations for large projects to be able to debug both javascript and java within IDE. In this scenario I think some sort of built-in mainstream browser or its extension is used within the IDE to support that specific browser.

A: 

Yes

Eclipse: http://www.eclipse.org/atf/flash/index4.php

Netbeans: http://netbeans.org/kb/67/web/js-debugger-ug.html

EDIT:

Aptana Studio provided dynamic javascript debugging (eclipse based, plugin version available) http://www.aptana.com/products/studio2

Alois Cochard
The eclipse reference you gave I had already studied it and even installed ATF. In that page it only talks about static html/javascript project and not dynamic java web application. I am also having issues with ATF, it does not work even for static javascript project.
Alan McCloud
The netbeans link is outdated. It does not work for current netbeans 6.9. The project properties have no debug category anymore, nor I am presented with the dialog specified there in which I choose javascript debug option, when I debug my project.
Alan McCloud
Gived a try some time and found immature too ... For eclipse I seen some 3rd party plugins ... I add in response if able to put hands on.
Alois Cochard
Take a look at Aptana Studio, hope that's help !
Alois Cochard
I cannot find any web reference that talks about javascript debuggin within Eclipse or Netbeans in the context of java based web application. The netbeans reference came close to it but it does not work for the current release of netbeans. It seems netbeans has removed this feature in the current release.
Alan McCloud
Unfortunately Aptana does not work with grails prjects.
Alan McCloud
Your question is tagged java, and I don't see any grails reference in it. Please edit it if you want answers relative to grails, thanks
Alois Cochard
A: 

Yes.

IntelliJ: http://www.jetbrains.com/idea/features/compiler.html

duffymo
I have only intellij Idea 8 license and cannot use intellij 9. Also my projects are more compatible with latest eclipse or netbeans. So I have stopped using intellij.
Alan McCloud
A: 

The only time I've seen client-side and server-side code in the same IDE was years ago with MSIE, which used Visual Studio as its Javascript debugging tool. To be honest though, it wasn't a particularly pleasant experience, and also it wasn't integrated with the rest of the project.

Part of the problem with the idea of debugging Javascript in the IDE is that there's no certainty of your JS code all being within your project. eg you could have loaded JQuery from Google's code repository. So your IDE would have to load the Javascript code from the browser, not from the project. Also, some code may have been dynamically generated or even updated at runtime by Ajax calls, so the IDE would need to keep up-to-date with the browser.

When you start to think about it in those terms, you can see that it would be a very difficult task to debug the JS in the IDE. It makes a lot of sense to keep that functionality in the browser.

Spudley