如何将 Struts2-jQuery 插件与 sitemesh 结合使用

发布于 2024-08-26 08:00:18 字数 1615 浏览 5 评论 0原文

当我尝试包含标签 (http://code. google.com/p/struts2-jquery/wiki/HeadTag) 在 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)

请问有什么想法吗?

提前致谢

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

Please any idea ?

Thanks in advance

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

少年亿悲伤 2024-09-02 08:00:18

答案在这里:

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>

现在,它工作正常(strut2、sitemesh 和 jquery)。

问候

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

痴情换悲伤 2024-09-02 08:00:18

我只是发现我必须将此过滤器添加到我的 web.xml

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

无论如何谢谢

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文