JSP EL表达式未评估

时间:2020-09-14 21:19:00

标签: java jsp jstl el

我已经搜索了该站点,但是没有找到解决方案。 EL Expression未得到评估。一切都可以通过Eclipse以及在我们的开发环境中运行,但是当部署到我们的测试服务器(Apahe / Tomcat9)时,一切都无法正常工作。即显示$ {title}而不是实际标题值。

使用:

    通过 调用的
  1. custom.tag
     <%@ tag language="java" pageEncoding="ISO-8859-1"%>
      <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 
      <%@ taglib uri="/WEB-INF/translator.tld" prefix="translator" %>
      <%@ attribute name="title" required="true"  %>
      <%@ attribute name="displayName" required="true" %>
      <%@ attribute name="showResults" required="true" %>

        <h1>${title}</h1> 
  1. Pom:
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
        <version>3.1.0</version>
    </dependency>
    <dependency>
        <groupId>javax.servlet.jsp</groupId>
        <artifactId>javax.servlet.jsp-api</artifactId>
        <version>2.3.1</version>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>jstl</artifactId>
        <version>1.2</version>
    </dependency>
  1. web.xml-尝试在v3.1中使用同样的问题
    <?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/webapp_4_0.xsd" 
    version="4.0">

0 个答案:

没有答案