2012-03-14 5 views
0

jsp/jstl/elを使用してJetty7スタンドアロンとSpring Webアプリケーションに問題が発生しています。 maven jetty-pluginを使用している間は問題なく動作しますが、すぐに私はJettyスタンドアロンに切り替えます。 ${foobar}は、バネタグと同様に無視されます。 Jetty7スタンドアロン+ jstl/jsp + spring 3 = el/springタグが動作しない

マイ例えばJSP

スプリングMVCコントローラを介してロードされる
<%@ 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} 

@RequestMapping(value = "") 
public String test(Model model) throws IOException { 
    model.addAttribute("hello", "world"); 

    return "html/example"; 
} 

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

私も<%@ page isELIgnored="false" %>を経由して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)); 

私はページのトン、ウェブ上の問題を経てきたし、まだこの問題を解決することができませんでした。 誰もが私を助けてくれることを願っています。前もって感謝します!

答えて

1

私の問題を修正したのはわかりませんが、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"> 

突然それが働き始めました。

関連する問題