Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jsp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring Jetty7独立+;jstl/jsp+;弹簧3=el/弹簧标签不工作_Spring_Jsp_Jstl_Jetty_El - Fatal编程技术网

Spring Jetty7独立+;jstl/jsp+;弹簧3=el/弹簧标签不工作

Spring Jetty7独立+;jstl/jsp+;弹簧3=el/弹簧标签不工作,spring,jsp,jstl,jetty,el,Spring,Jsp,Jstl,Jetty,El,我对Jetty7 standalone和使用jsp/jstl/el的SpringWeb应用程序有一些问题。 虽然使用maven jetty插件一切正常,但只要切换到jetty standalone,所有EL消息(如${foobar})以及spring标记都将被忽略 我的JSP示例 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <%@ taglib uri="http://www.springfra

我对Jetty7 standalone和使用jsp/jstl/el的SpringWeb应用程序有一些问题。 虽然使用maven jetty插件一切正常,但只要切换到jetty standalone,所有EL消息(如
${foobar}
)以及spring标记都将被忽略

我的JSP示例

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring" %>
<spring:message var="document_title" code="navigation.activity" />
<spring:message var="header_title" text="" code="navigation.activity" />
hello ${hello}
web.xml:

<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="
    http://java.sun.com/xml/ns/javaee
    http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="WebApp_ID"
version="2.5">
 ...

...
尝试使用或不使用以下依赖项:

    <dependency>
        <groupId>taglibs</groupId>
        <artifactId>fmt</artifactId>
        <version>1.1.2</version>
        <scope>runtime</scope>
        <type>tld</type>
    </dependency>

    <dependency>
        <groupId>taglibs</groupId>
        <artifactId>standard</artifactId>
        <version>1.1.2</version>
        <scope>runtime</scope>
    </dependency>

    <dependency>
        <groupId>taglibs</groupId>
        <artifactId>c</artifactId>
        <version>1.1.2</version>
        <scope>runtime</scope>
        <type>tld</type>
    </dependency>

    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>jstl</artifactId>
        <version>1.2</version>
        <scope>runtime</scope>
    </dependency>

塔格利布
fmt
1.1.2
运行时
tld
塔格利布
标准
1.1.2
运行时
塔格利布
C
1.1.2
运行时
tld
javax.servlet
jstl
1.2
运行时
我甚至尝试通过
从JSP内部启用EL,但随后出现如下异常:

An error occurred at line: 21 in the jsp file: /WEB-INF/template/html/example.jsp
Generated servlet error:
/tmp/jetty-0.0.0.0-8080-test.war-_-any-/jsp/org/apache/jsp/WEB_002dINF/template/html/example_jsp.java:268: cannot find symbol
symbol  : method proprietaryEvaluate(java.lang.String,java.lang.Class<java.lang.String>,javax.servlet.jsp.PageContext,<nulltype>,boolean)
location: class org.apache.jasper.runtime.PageContextImpl
      out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${hello}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
jsp文件:/WEB-INF/template/html/example.jsp的第21行出现错误
生成的servlet错误:
/tmp/jetty-0.0.0-8080-test.war-\uany-/jsp/org/apache/jsp/WEB\u 002dINF/template/html/example\u jsp.java:268:找不到符号
符号:方法proprietaryeevaluate(java.lang.String、java.lang.Class、javax.servlet.jsp.PageContext、boolean)
位置:class org.apache.jasper.runtime.PageContextImpl
out.write((java.lang.String)org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(${hello}),java.lang.String.class,(PageContext)jspx_page_context,null,false));
我已经浏览了大量网页和网络上的问题,但还不能解决这些问题。
希望有人能帮助我。提前谢谢

不确定是什么解决了我的问题,但我从pom中删除了所有jsp/jstl依赖项,并将web.xml设置为3.0

<web-app
    xmlns="http://java.sun.com/xml/ns/javaee" 
    xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
    id="Your_Webapp_ID" version="3.0">

突然,它开始工作了

<web-app
    xmlns="http://java.sun.com/xml/ns/javaee" 
    xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
    id="Your_Webapp_ID" version="3.0">