IntelliJ IDEA上创建Maven Web项目的时候,EL表达式无法解析异常

来源:互联网 发布:申通淘宝面单打印软件 编辑:程序博客网 时间:2024/05/16 19:13

部署一个项目时,报了这样的异常: 

org.apache.jasper.JasperException: Unable to convert string "${topic.postTime}" to class "java.util.Date" for attribute "value": Property Editor not registered with the PropertyEditorManager 

主要原因是EL表达式无法被解析到. 解析不到EL表达式,引起的原因是web.xml中: 

<!DOCTYPE web-app PUBLIC
        "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
        "http://java.sun.com/dtd/web-app_2_3.dtd" >

<web-app>

IntelliJ IDEA上创建Maven Web项目的时候,默认web.xml是2.3版本

在不改变web.xml2.3版本的情况下解决办法是:在jsp页面头加:<%@page isELIgnored="false"%>   问题得以解决。 


当然,还可以改变web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<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">


原创粉丝点击