Here you have the answer :-)
Remember: the value params will always be resolved against the
ValueStack so if you mean to pass a string literal to your component,
make sure to wrap it in quotes i.e. value="'value1'" otherwise, the
the value stack will search for an Object on the stack with a method
of getValue1(). (now that i've written this, i'm not entirely sure
this is the case. i should verify this manana)
So it must be:
<s:component template="mycomponent.jsp" >
<s:param name="message" value="'Welcome To'" />
</s:component>
(additional single quotes)
2014-03-16 14:51 GMT+01:00 [email protected] <[email protected]>:
> I'm working on JIRA WW-4299 and am trying to setup an example application to
> validate the problem the person reported with the Struts component tag and
> parameters.
>
> In my example app (see attached zip file) I have this markup in index.jsp:
>
> <%@taglib prefix="s" uri="/struts-tags" %>
>
> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
> <head>
> <title>Index</title>
>
> </head>
> <body>
> <s:component template="mycomponent.jsp" >
> <s:param name="message" value="Welcome To" />
> </s:component>
>
>
> </body>
> </html>
>
> In mycomponent.jsp I have this markup:
>
> <%@taglib prefix="s" uri="/struts-tags" %>
>
> Hello and <s:property value="%{parameters.message}" /> My JSP Component
>
>
> When index.action is run which just results in index.jsp being returned the
> page does not include the value of parameters.message - I just see Hello and
> My JSP Component
>
> I'm following the Struts 2 component tag guide here:
> http://struts.apache.org/release/2.3.x/docs/component.html
>
> Any help would be appreciated so I can get a working example that uses the
> component tag and parameters so I can validate the person's issue.
>
> strutscomponentexample.zip
> <http://struts.1045723.n5.nabble.com/file/n5715502/strutscomponentexample.zip>
>
>
>
> --
> View this message in context:
> http://struts.1045723.n5.nabble.com/Need-Help-Getting-s-component-tag-with-parameter-to-work-tp5715502.html
> Sent from the Struts - Dev mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]