Intellij ideal 新建web项目的web资源目录不能自动映射问题
2015-08-11 15:30
387 查看
在用intelij ideal新建web项目时候,有时为了方便直接拷贝或者修改另外一个web项目,有时候会遇到一个问题,那就是在dispatch-servlet.xml配置文件中,无法自动适配到资源目录,细心的人会发现此时的web资源目录跟正常的不同,正常的web目录应该如下图样式
这里的webroot为我们的web资源目录,文件夹上面有个Internet标志的,如果你的项目配置不正常的话是不显示的。当不正常的情况下如何修改呢?其实只是在对应的项目的.iml文件下修改或者增加以下内容即可:
<module xxxxx>
<component name="FacetManager">
<facet type="web" name="Web">
<configuration>
<descriptors>
<deploymentDescriptor name="web.xml" url="file://$MODULE_DIR$/webroot/WEB-INF/web.xml" />
</descriptors>
<webroots>
<root url="file://$MODULE_DIR$/webroot" relative="/" />
</webroots>
<sourceRoots>
<root url="file://$MODULE_DIR$/src/main/java" />
<root url="file://$MODULE_DIR$/src/main/resources" />
</sourceRoots>
</configuration>
</facet>
<facet type="Spring" name="Spring">
<configuration />
</facet>
</component>
这里的webroot为我们的web资源目录,文件夹上面有个Internet标志的,如果你的项目配置不正常的话是不显示的。当不正常的情况下如何修改呢?其实只是在对应的项目的.iml文件下修改或者增加以下内容即可:
<module xxxxx>
<component name="FacetManager">
<facet type="web" name="Web">
<configuration>
<descriptors>
<deploymentDescriptor name="web.xml" url="file://$MODULE_DIR$/webroot/WEB-INF/web.xml" />
</descriptors>
<webroots>
<root url="file://$MODULE_DIR$/webroot" relative="/" />
</webroots>
<sourceRoots>
<root url="file://$MODULE_DIR$/src/main/java" />
<root url="file://$MODULE_DIR$/src/main/resources" />
</sourceRoots>
</configuration>
</facet>
<facet type="Spring" name="Spring">
<configuration />
</facet>
</component>
相关文章推荐
- Netfilter
- android 全局路径变量
- Regular Expresssion Matching
- Centos下通过SMTP发送邮件失败解决
- 有一种办公室恶习 叫 陪加班
- ResultMap
- LeetCode -- 查找最小公共祖先
- SQL 2012 安装
- npc显示主机监控状态,不显示服务监控状态
- fedora22弃用yum改用dnf
- POJ 1426 Find The Multiple
- java中判断字符串是否为空
- MySQL必知必会笔记(五)事务处理 全球化和本地化(字符集和校对)
- ACM所有算法
- ireport自定义JFreeChart折线图
- 黑马程序员——java复习总结——Java基础知识
- 字典树
- js 小数[非]四舍五入
- SQL-数据库邮箱配置
- 每天一个Linux命令-13(tcpdump)