IntelliJ IDEA解析JSP中的Web路径 [英] IntelliJ IDEA resolving web paths in JSP
问题描述
如何设置IntelliJ查找JSP中引用的文件的位置?如果我有
How can I set where IntelliJ looks for files referenced in a JSP? If I have
<jsp:include page="/foo/bar" />
它无法解析目录foo。
it cannot resolve directory foo.
它看起来像设置>网络上下文处理这个,但当我去那里,它说
It looks like Settings > Web Contexts deals with this, but when I go there, it says
没有找到网页目录
No web directories found
推荐答案
您应该在项目设置中配置Web构面,然后配置包含的目录foo
作为Web资源目录。如果这是您的根目录,请将相对于部署根目录的路径设置为 /
。
You should configure a web facet in your project settings, then configure the directory containing foo
as a "Web Resource Directory". If this is your root directory, set the "Path Relative to Deployment Root" to /
.
请参阅< a href =http://www.jetbrains.com/idea/webhelp/enabling-web-application-support.html\"rel =noreferrer>官方文档了解更多信息。
这篇关于IntelliJ IDEA解析JSP中的Web路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!