The parameter <s: param> is used on the home page. The parameter cannot be obtained using the struts2 tag on the Child page.
<S: property value = "# request. Operation"/>
Or <s: property value = "operation"/>
Or <s: property value = "% {# ATTR. Operation}"/>
No value is obtained,
I found a buddy's original article on the Internet:
Explanation:
I read the struts2 document, saying that ognl cannot be obtained from valuestack because include does not update valuestack. This document also describes how to use jstl on the page:
$ {Param. Operation}
However, I do not want to mix struts labels and jstl labels for the purpose of unified the whole site. Therefore, I hope to solve it only by using struts2. According to the Buddy's article, the solution is as follows:
Input parameters on the parent page:
<S: Include value = "/JSP/include_vedio/head. JSP "> <% -- upload the page title -- %> <s: Param name =" page_title "> modify the page title </S: param> </S: Include>
Add the following code to the subpage:
<% @ Page import = "com. opensymphony. xwork2.ognl. ognlvaluestack "%> <% (ognlvaluestack) request. getattribute ("struts. valuestack ")). set ("page_title", request. getparameter ("page_title"); %> <s: If test = "page_title! = NULL "> <s: Property escape =" false "value =" page_title "/>-website </S: If> <s: else> website </S: else>
Then you can use the struts2 tag <s: property value/> to obtain the value.
From: http://wenku.baidu.com/view/b23a4e26aaea998fcc220eef.html
Thanks to the original author. This article is based on the original article.