一、问题描述
我使用Maven创建了webApp项目,发现项目中的EL表达式不能解析。在网上查询,发现Maven创建的web项目默认使用的约束:web-app_2_3.dtd
想,它默认支持EL表达式。而目前常用的约束是`web-app_3_1.xsd。于是我在网上查询了webapp3.1的约束替换了自动生成的web2.3的约束,如下所示
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
</web-app>
每次需要web3.1约束都要去网上查找太麻烦了
二、问题解决
使用IDEA的Live templates操作流程:File --> settings–>Editor–>Live Template
在HTML/XML下添加Live templates