TOMCAT integration issue

Hi people.
I have been trying IntelliJ (5.1) for some days and I like it a lot! However, I got a little issue using it.

I'm not a TOMCAT expert, and I'm trying to develop a little web application with IntelliJ. My problem is the following :
- when specifying a resource (URI), I understood TOMCAT isn't aware of the running web application, and he needs a path like this one /mywebapp/resource.ext. Of course, if the page shares the same directory as the resource, I could shorten by saying resource.ext
- IntelliJ is aware of the web application, thus, when I specify a resource like an image in an HTML or JSP page, IntelliJ gives a wrong code-completion : IntelliJ omits the /myweapp/ string. And when TOMCAT expects something like /mywebapp/resource.ext, IntelliJ simply says /resource.ext, but this isn't very convenient.

This is of course awful, because when refactoring (moving jsp files from a directory to another for instance), IntelliJ refactors erronously. Plus, when I specify the path myself, say /mywebapp/resource.ext, IntelliJ underlines it in red, and it feels annoying.

Also, maybe I'm just wrong and there is a way to make TOMCAT aware of the web-application, and then omitting the /my-webapp/ string every time. I'd prefer so.

I hope I was clear and someone will find some minutes to help me out =)

1 comment


We're trying to address this issue in forthcoming IDEA version. You can
track the progress/see more details in our bug tracker at following URLs:

As a workaround you might do following:

1) While developing your app, set the "/myApp/" path relative to
deployment root for your resource folder in Web Module Settings and
deploy it to "/" context path. IDEA will automatically pack your web
application under "/myApp/" folder, and every completion/highlighting
should honor this setting.

2) When you're ready to deploy your app to production server with
"/myApp" context path, change relative path of your resource root "/",
rebuild the application, and deploy it with "/myApp" context root.

This should work. Sorry for inconvenience. We'll make everything
possible to solve this problem in 6.0 release.


Please sign in to leave a comment.