You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Olof Olsson <Ol...@team.telstraclear.co.nz> on 2003/05/06 23:50:37 UTC

Nested Struts taglib tags within quotation mark delimited string

Hi,

I've got a problem creating a string (enclosed in quotation marks) that I
need to pass as an argument to a Javascript function. Basically, the string
needs to be created as follows:

"<html:rewrite page='<tiles:getAsString name='URI' />'"

This is obviously syntactically incorrect, since the quotation marks are not
nested properly. (I got a ' within a '). And this nesting of quotation marks
is my problem... Is it possible to do what I want to do without introducing
a scriptlet? I would like to avoid scriptlets in my code if at all possible.

Been looking hard at the taglib docs, but cannot find a solution.

Many thanks!

	--Olof

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


Re: Nested Struts taglib tags within quotation mark delimited string

Posted by Gareth Andrew <ga...@ntlworld.com>.
<bean:define id="uri">

<tiles:getAsString name='URI' />

</bean:define>

<html:rewrite page='<%=uri%>'/>

or if you are using struts-el tags

<html:rewrite page='${uri}'/>

Gareth

Olof Olsson wrote:

>Hi,
>
>I've got a problem creating a string (enclosed in quotation marks) that I
>need to pass as an argument to a Javascript function. Basically, the string
>needs to be created as follows:
>
>"<html:rewrite page='<tiles:getAsString name='URI' />'"
>
>This is obviously syntactically incorrect, since the quotation marks are not
>nested properly. (I got a ' within a '). And this nesting of quotation marks
>is my problem... Is it possible to do what I want to do without introducing
>a scriptlet? I would like to avoid scriptlets in my code if at all possible.
>
>Been looking hard at the taglib docs, but cannot find a solution.
>
>Many thanks!
>
>	--Olof
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>  
>



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