首页 > 学院 > 开发设计 > 正文

IDEA下maven项目无法提示和使用EL表达式的解决办法

2019-11-06 07:57:31
字体:
来源:转载
供稿:网友

一、如果jsp中无法自动提示EL表达式,比如${pageContext.request.contextPath},可在pom.xml<dependencies>标签中插入以下代码

<dependency> <groupId>javax.servlet</groupId> <artifactId>jsp-api</artifactId> <version>2.0</version> <scope>PRovided</scope></dependency>

二、如果无法使用EL表达式 方法1:更改web.xml的web-app标签中的命名空间,可改成如下

<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>

方法2:在jsp页面开头添加<%@ page isELIgnored="false"%>


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表