开发者

How to use Struts2-jQuery Plugin with sitemesh

开发者 https://www.devze.com 2022-12-24 02:15 出处:网络
I have this error when I try to include thetag (http://code.google.com/p/struts2-jquery/wiki/HeadTag) in a sitemesh decorator

I have this error when I try to include the tag (http://code.google.com/p/struts2-jquery/wiki/HeadTag) in a sitemesh decorator

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 Error

exception

java.lang.RuntimeException: org.apache.jasper.JasperException: An exception occurred processing JSP page /decorators/main.jsp at li开发者_JAVA技巧ne 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)

Please any idea ?

Thanks in advance


here the answer:

web.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>

Now, its working fine (strut2, sitemesh and jquery).

Regards


I just figure out that I must add this filter to my web.xml

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

Thanks any way

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号