2010-03-26 27 views
0

我有這樣的錯誤,當我嘗試包括在SiteMesh的裝飾如何使用Struts2的,jQuery插件使用的sitemesh

main.jsp (decorator) 
<%@ taglib uri="http://www.opensymphony.com/sitemesh/decorator" prefix="decorator" %> 
<%@ taglib prefix="s" uri="/struts-tags"%> 
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%> 


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 
    <title>My Project- <decorator:title /></title> 
    <sj:head compressed="false" jqueryui="true"></sj:head> 
</head> 
<body> 
    <!-- head --> 
.... 

Tomcat的錯誤

exception 

java.lang.RuntimeException: org.apache.jasper.JasperException: An exception occurred processing JSP page /decorators/main.jsp at line 11 

8: <head> 
9: <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 
10: <title>My Project- <decorator:title /></title> 
11: <sj:head compressed="false" jqueryui="true"></sj:head> 
12: </head> 
13: <body> 
14: <!-- head --> 


Stacktrace: 
com.opensymphony.sitemesh.webapp.decorator.BaseWebAppDecorator.render(BaseWebAppDecorator.java:39) 
com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java:84) 

請任何想法標籤(http://code.google.com/p/struts2-jquery/wiki/HeadTag)?

在此先感謝

回答

1

這裏的答案添加到我的web.xml

<filter> 
    <filter-name>struts-cleanup</filter-name> 
    <filter-class>org.apache.struts2.dispatcher.ActionContextCleanUp</filter-class> 
</filter> 

感謝:

網.xml

<filter> 
    <filter-name>struts-cleanup</filter-name> 
    <filter-class>org.apache.struts2.dispatcher.ActionContextCleanUp</filter-class> 
</filter> 
<filter-mapping> 
    <filter-name>struts-cleanup</filter-name> 
    <url-pattern>/*</url-pattern> 
</filter-mapping> 

現在,它的工作正常(strut2,sitemesh和jquery)。

Regards

1

我只是弄清楚,我必須在此過濾器的任何方式