You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Sawan <sa...@gmail.com> on 2007/08/01 11:08:02 UTC
HTML Encoding in Struts2
Hi experts,
I have following code...
JAVA:
ArrayList obj = new ArrayList();
obj.add(" www.google.com Visit google ");
obj.add(" www.yahoo.com Visit yahoo ")
JSP:
<s:iterator value = "obj ">
<s:property />
</s:iterator>
On jsp page source, I am getting "<a
href="www.google.com">Visit google</a>" and
"<a href="www.yahoo.com">Visit yahoo</a>"
So it is not linking "Visit google" and "Visit yahoo", instead of it is
showing the whole string " www.google.com Visit google " and www.yahoo.com
Visit yahoo .
How can I make both linkable..?
Thanks in advance
Sawan
--
View this message in context: http://www.nabble.com/HTML-Encoding-in-Struts2-tf4198863.html#a11942087
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: HTML Encoding in Struts2
Posted by Toni Lyytikäinen <to...@gmail.com>.
http://struts.apache.org/2.x/docs/property.html
The property tag escapes the string by default. Try <s:property
escape="false" />
On 8/1/07, Sawan <sa...@gmail.com> wrote:
>
>
> Hi experts,
>
> I have following code...
>
> JAVA:
> ArrayList obj = new ArrayList();
> obj.add(" www.google.com Visit google ");
> obj.add(" www.yahoo.com Visit yahoo ")
>
> JSP:
> <s:iterator value = "obj ">
> <s:property />
> </s:iterator>
>
> On jsp page source, I am getting "<a
> href="www.google.com">Visit google</a>" and
> "<a href="www.yahoo.com">Visit yahoo</a>"
>
> So it is not linking "Visit google" and "Visit yahoo", instead of it is
> showing the whole string " www.google.com Visit google " and
> www.yahoo.com
> Visit yahoo .
>
> How can I make both linkable..?
>
> Thanks in advance
>
> Sawan
>
>
> --
> View this message in context:
> http://www.nabble.com/HTML-Encoding-in-Struts2-tf4198863.html#a11942087
> 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: HTML Encoding in Struts2
Posted by Sawan <sa...@gmail.com>.
THANKS...Its working now...:jumping:
--
View this message in context: http://www.nabble.com/HTML-Encoding-in-Struts2-tf4198863.html#a11942434
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: HTML Encoding in Struts2
Posted by Dave Newton <ne...@yahoo.com>.
--- Sawan <sa...@gmail.com> wrote:
> On jsp page source, I am getting "<a
> href="www.google.com">Visit
> google</a>" and
> "<a href="www.yahoo.com">Visit
> yahoo</a>"
>
> How can I make both linkable..?
http://struts.apache.org/2.x/docs/property.html
Note the "escape" attribute.
Now you can be an expert too!
d.
____________________________________________________________________________________
Be a better Heartthrob. Get better relationship answers from someone who knows. Yahoo! Answers - Check it out.
http://answers.yahoo.com/dir/?link=list&sid=396545433
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org