如何在sitemesh的装饰页面上调用action类的成员? [英] How do I call a member of action class on sitemesh's decorator page?

查看:73
本文介绍了如何在sitemesh的装饰页面上调用action类的成员?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨..

现在我是strme-2.3.12的sitemesh3。



在struts动作结果的页面中,可以调用属性,但是在装饰页面上它们不能被调用。



web.xml

Hi..
Now I''m sitemesh3 with struts-2.3.12.

In the page that struts action resulted, properties can be called but on decorator page they can''t be called.

web.xml

...
<filter>
	<filter-name>sitemesh3</filter-name>
	<filter-class>org.sitemesh.config.ConfigurableSiteMeshFilter</filter-class>
</filter>

<filter-mapping>
	<filter-name>sitemesh3</filter-name>
	<url-pattern>/*</url-pattern>
</filter-mapping>

	<!-- Struts Config (needs to be after struts) -->
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
	<filter-name>struts2</filter-name>
	<url-pattern>/*</url-pattern>
</filter-mapping>
...





main.jsp(装饰页)





main.jsp(decorator page)

<sitemesh:write property="head">

     <s:property value="myValue" /><!-- if I delete this line, it runs. But I needs this functionality.-->
     <sitemesh:write property="body">





result.jsp



result.jsp

<s:property value="myValue">





sitemesh3.xml



sitemesh3.xml

<sitemesh>
<mapping path="*" decorator="/views/sitemesh/main.jsp"/>





在struts动作类中,定义了getter和myValue的setter。

是否需要设置配置或添加一些插件?

有什么问题?

请帮帮我...



In struts action class , there defined getter and setter for myValue.
Is there necessary for setting the configuration or adding some plugins?
What''s the problem?
Please help me...

推荐答案

您好,



根据Sitemesh文档,您只能检索HTMLPage的属性。请参阅[ ^ ] API文档。



问候,
Hello,

As per Sitemesh documentation you can only retrieve the properties of HTMLPage. Please refer to this[^] API doc.

Regards,


这篇关于如何在sitemesh的装饰页面上调用action类的成员?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆