how to setup web resource directory?
IDEA provides a nice feature to validate availability of resources, just as jsp, images and css files. However, I am having trouble to set them right.
Surposing I have a web project with two resource directorys:
myproject/web/images
myproject/web/jsp
and I'd like to have the img tag in jsps refers images using a relative path, such as <img src="../images/myimage.gif"/>. Is it possible to have IntelliJ to validate availability this way (use ctrl click)?
So far, I can get ctrl-click to work only with an absolute path, such as <img src="/images/myimage.gif"/>. But an absolute path is actually wrong in context of jsps, as the path depends on deployment.
Message was edited by:
frank luo
Please sign in to leave a comment.
considering yoursetup, it should work if you setup
myproject/web
as a web resource folder
you mean setting "myproject/web" as "/" ?
I haved tried that and the images can be access by "/images/myimage.jpg". However, that is not a right approach because local resources should not be accessed via an absolute path. A path like that is only good when deployed as root, but will be wrong if deployed as "myproject", for example.
I don't understand the problem.
Attached is a module created with IDEA 6, where a test.html uses relative paths for resolving anchor or images
Message was edited by:
Thibaut (typos)
Attachment(s):
TestWeb.rar