javaee idea创建maven项目,使用el和jstl

如果使用el表达式出现下图问题

解决办法

这是因为maven创建项目时,web.xml头部声明默认是2.3,这个默认jsp关闭el表达式

办法1

在每个需要用到el和jstl的页面的上面加一句:

html 复制代码
 <%@ page isELIgnored="false" %>    

方法2 修改web.xml文件开头的web-app的版本

改为 3.0(2.4以后都可以,太高也不行,要注意配合tomcat支持的版本)

xml 复制代码
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
 xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
id="WebApp_ID" version="3.0">


相关推荐
CHHYQMGDCDZu2 小时前
光伏系统参数
maven
2301_818732065 小时前
前端调用控制层接口,进不去,报错415,类型不匹配
java·spring boot·spring·tomcat·intellij-idea
不倒翁玩偶12 小时前
IDEA导入新的SpringBoot项目没有启动按钮
java·spring boot·intellij-idea
Aric_Jones14 小时前
idea使用.env运行SpringBoot项目
java·spring boot·intellij-idea
我命由我1234516 小时前
Java 泛型 - Java 泛型通配符(上界通配符、下界通配符、无界通配符、PECS 原则)
java·开发语言·后端·java-ee·intellij-idea·idea·intellij idea
猫头虎1 天前
如何排查并解决项目启动时报错Error encountered while processing: java.io.IOException: closed 的问题
java·开发语言·jvm·spring boot·python·开源·maven
李少兄1 天前
在 IntelliJ IDEA 中修改 Git 远程仓库地址
java·git·intellij-idea
凯尔萨厮1 天前
Maven(Windows下载安装)
笔记·maven
先跑起来再说1 天前
Git 入门到实战:一篇搞懂安装、命令、远程仓库与 IDEA 集成
ide·git·后端·elasticsearch·golang·intellij-idea
golang学习记1 天前
IntelliJ IDEA 2025.3 重磅发布:K2 模式全面接管 Kotlin —— 告别 K1,性能飙升 40%!
java·kotlin·intellij-idea