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:


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

Comment actions Permalink

considering yoursetup, it should work if you setup
as a web resource folder

Comment actions Permalink

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.

Comment actions Permalink

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)


Please sign in to leave a comment.