struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "shenxiaojing" <leftka...@sina.com>
Subject 答复: struts2.1.8 generator tag problem
Date Sun, 18 Oct 2009 12:47:28 GMT
Thank you for the advice.:)


-----邮件原件-----
发件人: Dale Newfield [mailto:dale@newfield.org] 
发送时间: 2009年10月18日 12:30
收件人: Struts Users Mailing List
主题: Re: struts2.1.8 generator tag problem

shenxiaojing wrote:
> http://struts.apache.org/2.1.8/docs/generator.html
> Example Three doesn't work!!!

Unless I'm mistaken the documentation (in this case in the code 
comments) is not correct.  It doesn't put it in the PageContext, it puts 
it into the context that's a part of the OGNL ValueStack.

So (I'm guessing, I haven't tested any of this) if you set var="blah" 
you should be able to use it via <s:iterator 
value="#blah">...</s:iterator> or in a scriptlet from just the 
pageContext via 
((ValueStack)(((HttpServletRequest)pageContext.getRequest()).getAttribute(Se
rvletActionContext.STRUTS_VALUESTACK_KEY))).getContext().get("blah")

If you want to promote something from the ognl context to the 
pageContext, look at the s:set tag, with scope="page".

-Dale

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message