You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by tibi <ti...@dds.nl> on 2009/09/16 20:17:59 UTC

use param from own tag in struts tag

i hope this question is not asked and answerd i find it quite difficult to
google on it because i'm not sure how to name things :(

ok here my problem.

i have my own tag like this:
<my:userForm saveMethod="saveManager"/>

my tag looks like this:

<%@ include file="/common/taglibsForTags.jsp"%>
<%@ attribute name="saveMethod" %>
${saveMethod} <!---this woks and will print out the value -->
<s:submit key="button.save" method="%{saveMethod}"/><!--will add a submit
button but there is no method name -->

of i would do this:
<s:submit key="button.save" method="${saveMethod}"/>
i get an security error.

so how can i add the ${saveMethod} value into a struts tag??

thanks,

tibi


-- 
View this message in context: http://www.nabble.com/use-param-from-own-tag-in-struts-tag-tp25477711p25477711.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: use param from own tag in struts tag

Posted by tibi <ti...@dds.nl>.
dale,

perfect! tomorrow at work i will try this new insight and share the
knowledge which was lacking here:

http://www.nabble.com/my-tag-td25472559s2369.html

tibi
-- 
View this message in context: http://www.nabble.com/use-param-from-own-tag-in-struts-tag-tp25477711p25479344.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: use param from own tag in struts tag

Posted by Dale Newfield <da...@newfield.org>.
tibi wrote:
> sounds great. can you provide me with an example. 

The easiest thing is to pass it through some common scope.  You'll have 
to decide which scope to use.  If the tag is not recursive, you can just 
use the request scope.

If ${jstlFoo} prints "FOO"

then

<c:set var="ognlFoo" scope="request" value="${jstlFoo}"/>
<s:property value="%{#request.ognlFoo}"/>

should also print "FOO"

-Dale

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


Re: use param from own tag in struts tag

Posted by tibi <ti...@dds.nl>.


tibi wrote:
> <%@ include file="/common/taglibsForTags.jsp"%>
> <%@ attribute name="saveMethod" %>
> ${saveMethod} <!---this woks and will print out the value -->

This shows that the value is available to jstl.  You can use various 
other tags (c:set for example) to set that value in a location 
addressable by ognl.

-Dale
dale,
sounds great. can you provide me with an example. 

thanks

tibi
-- 
View this message in context: http://www.nabble.com/use-param-from-own-tag-in-struts-tag-tp25477711p25479051.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: use param from own tag in struts tag

Posted by Dale Newfield <da...@newfield.org>.
tibi wrote:
> <%@ include file="/common/taglibsForTags.jsp"%>
> <%@ attribute name="saveMethod" %>
> ${saveMethod} <!---this woks and will print out the value -->

This shows that the value is available to jstl.  You can use various 
other tags (c:set for example) to set that value in a location 
addressable by ognl.

-Dale

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