Hi everyone, I'm using <s:include> to include a page fragment in Struts 2.1.2. (also tried with <jsp:include> and the result did not change)
Ensuring the values are passed as Strings using OGNL syntax: <s:include value="/support/templates/header.jsp"> <s:param name="pageTitle" value="%{'Portal Administration'}" /> <s:param name="nav1" value="%{'portalAdmin'}" /> <s:param name="nav2" value="%{''}" /> </s:include> I know nav1 makes it into header.jsp as a request parameter because this snippet yields "nav1 = portalAdmin" (among other things) <% java.util.Enumeration e = request.getParameterNames(); while (e.hasMoreElements()) { String name = (String) e.nextElement(); out.write(" " + name + " = " + request.getParameter(name) + "<br />"); } %> (BTW, I tried removing %{''} from the <s:param> tag and nav1 was null) In header.jsp I tried getting the value of nav1 using several different OGNL mechanisms: Nav 1a: <s:property value="#attr.nav1"/><br /> Nav 1b: <s:property value="%{#attr.nav1}"/><br /> Nav 1c: <s:property value="#attr['nav1']"/><br /> Nav 1d: <s:property value="%{#attr['nav1']}"/><br /> Nav 2a: <s:property value="#parameters.nav1"/><br /> Nav 2b: <s:property value="%{#parameters.nav1}"/><br /> Nav 2c: <s:property value="#parameters['nav1']"/><br /> Nav 2d: <s:property value="%{#parameters['nav1']}"/><br /> In theory all of the above should work because nav1 is a request parameter and attr looks to request scope after page scope. However, none of the above tags display the value of nav1. Of course if I can't even get the value of that parameter my <s:if> logic won't work. Feels like I missed something obvious.... --------------------------------------------------------------------- This message, together with any attachments, is intended only for the use of the individual or entity to which it is addressed. It may contain information that is confidential and prohibited from disclosure. If you are not the intended recipient, you are hereby notified that any dissemination or copying of this message or any attachment is strictly prohibited. If you have received this message in error, please notify the original sender immediately by telephone or by return e-mail and delete this message, along with any attachments, from your computer. Thank you. --------------------------------------------------------------------- --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]