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 =)
Thanks!
请先登录再写评论。
Hi!
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:
http://www.jetbrains.net/jira/browse/IDEADEV-5408
http://www.jetbrains.net/jira/browse/IDEA-5692
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.