You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by yitzle <yi...@users.sourceforge.net> on 2007/06/01 21:03:34 UTC

Using a tag as an attribute value

I got a linkIf.tag file that's working well. It checks the test and
either creates a link the the url with the body as the link content
(ie < a href="<%=url%>" ><jsp:doBody /></a>) or just shows the body
sans link.

<html:linkIf test="0" url="manager.action">
	<s:property value="online"/>
</html:linkIf >

I want to set the test attribute to be <s:property value="online"/>,
and that's where I run into trouble.
I tried:

<html:linkIf test="<s:property value="online"/>" url="manager.action">
and
<html:linkIf url="DevieManager.action">
	<jsp:param name="test">
		<s:property value="devicesOnline"/>
	</jsp:param>
and a bunch of random other bad ideas.

Can someone suggest a solution?
Other tips on the code presented would also be good to hear.
Thanks!
 - Isaac

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


Re: Using a tag as an attribute value

Posted by yitzle <yi...@users.sourceforge.net>.
> Shouldn't that be jsp:attribute rather than jsp:param?...
>
> L.
Erm... Maybe?
I got it working ->
<html:linkIf test="%{online}" url="manager.action">

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


Re: Using a tag as an attribute value

Posted by Laurie Harper <la...@holoweb.net>.
yitzle wrote:
> I got a linkIf.tag file that's working well. It checks the test and
> either creates a link the the url with the body as the link content
> (ie < a href="<%=url%>" ><jsp:doBody /></a>) or just shows the body
> sans link.
> 
> <html:linkIf test="0" url="manager.action">
>     <s:property value="online"/>
> </html:linkIf >
> 
> I want to set the test attribute to be <s:property value="online"/>,
> and that's where I run into trouble.
> I tried:
> 
> <html:linkIf test="<s:property value="online"/>" url="manager.action">
> and
> <html:linkIf url="DevieManager.action">
>     <jsp:param name="test">
>         <s:property value="devicesOnline"/>
>     </jsp:param>
> and a bunch of random other bad ideas.
> 
> Can someone suggest a solution?
> Other tips on the code presented would also be good to hear.
> Thanks!
> - Isaac

Shouldn't that be jsp:attribute rather than jsp:param?...

L.


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