首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在sitemesh中使用Struts2-jQuery插件

如何在sitemesh中使用Struts2-jQuery插件
EN

Stack Overflow用户
提问于 2010-03-27 01:25:58
回答 2查看 2.3K关注 0票数 0

当我试图在一个sitemesh装饰器中包含标签(http://code.google.com/p/struts2-jquery/wiki/HeadTag)时,我遇到了这个错误

代码语言:javascript
复制
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错误

代码语言:javascript
复制
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)

你有什么想法吗?

提前感谢

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2010-05-05 23:49:35

下面是答案:

web.xml

代码语言:javascript
复制
<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)。

问候

票数 1
EN

Stack Overflow用户

发布于 2010-03-27 01:36:11

我想我必须将这个过滤器添加到我的web.xml中

代码语言:javascript
复制
<filter>
    <filter-name>struts-cleanup</filter-name>
    <filter-class>org.apache.struts2.dispatcher.ActionContextCleanUp</filter-class>
</filter>

不管怎样,谢谢你

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/2525308

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档