All,

It's been a while since I've done any Struts (JSP for that matter) development, and I'm trying to get started with Struts 2.

Here's a very simple template that pulls in an include that provides the <head>...</head> content for the page.

<!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">
<%@ taglib prefix="s" uri="/struts-tags" %>

<jsp:include page="/include/head.jsp" flush="true">
  <jsp:param name="title" value="<s:property value="pageTitle"/>" />
  <jsp:param name="companyName" value="<s:property value="companyName"/>" />
</jsp:include>

<body>
</body>
</html>

I have an action that sets the values of pageTitle and companyName and I've verified that they have values.

My problem is I don't know how to co rrectly pass the pageTitle and companyName values set in my action (and retrievable only through OGNL, AFAIK) to the include via the standard <jsp:param> tag.  What is above doesn't work because of the double quotes.  So, here are my questions...

1) Is there a way to quote the contents of the <s:property> tag so that I can pass it successfully to the include?
2) Do I have to put the value of <s:property value="pageTitle"> (for example) into a local JSP variable just to pass it to the include?

What am I doing wrong?

Thanks,
Wes

Reply via email to