You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-user@tomcat.apache.org by Steve Vanspall <st...@crmsoftware.com.au> on 2002/09/30 04:23:07 UTC

Help with c.out and html code

Hi there,

I am new to JSTL.

I am used to using Struts tags and Scriptlets to process my JSP's. However, a suggetstion was made that JSTL would solve a problem I was having with scriplets in Tomcat.


Basically, I have a list of java-beans. I have programmed this list to create the html for each bean as it is added to it. This way removing the need for a second iteration throught the list in the JSP.

This part works fine.

I used to use the Java <%= tag to print the html code into the JSP.

e.g. <%=form.getBeanList().getHtml%>

I want to use JSTL to do the same thing, but when I use <c:out value="${AdminProdAttrForm.genAttribs.html}">

I get the html code with the appropriate escape character encoding instead.

i.e. &lt; instead of < etc.

is there a way to stop the tag from escaping these characters??

any help would be appreciated.

regards

Steve



Re: Help with c.out and html code

Posted by Shawn Bayern <ba...@essentially.net>.
On Mon, 30 Sep 2002, Steve Vanspall wrote:

> thanks for that,
> 
> You don't know where I can find a reference to all the tags available do
> you?

JSTL is a standard; you can download the specification through

	http://java.sun.com/products/jstl

The specification is authoritative.  There are also several books out on
JSTL, including mine ("JSTL in Action").

-- 
Shawn Bayern
"JSTL in Action"   http://www.jstlbook.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Help with c.out and html code

Posted by Steve Vanspall <st...@crmsoftware.com.au>.
thanks for that,

You don't know where I can find a reference to all the tags available do
you?

the links around seem to forward to partial exceprts from books, but don't
go into much details with the tag attributes.

Regards

Steve
----- Original Message -----
From: "Shawn Bayern" <ba...@essentially.net>
To: "Tag Libraries Users List" <ta...@jakarta.apache.org>
Sent: Monday, September 30, 2002 12:37 PM
Subject: Re: Help with c.out and html code


> On Mon, 30 Sep 2002, Steve Vanspall wrote:
>
> > I want to use JSTL to do the same thing, but when I use <c:out
> > value="${AdminProdAttrForm.genAttribs.html}">
> >
> > I get the html code with the appropriate escape character encoding
> > instead.
> >
> > i.e. &lt; instead of < etc.
> >
> > is there a way to stop the tag from escaping these characters??
> >
> > any help would be appreciated.
>
> Sure - set the 'escapeXml' attribute of <c:out> to 'false:
>
>   <c:out
>     value="${AdminProdAttrForm.genAttribs.html}"
>     escapeXml="false" />
>
> --
> Shawn Bayern
> "JSTL in Action"   http://www.jstlbook.com
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Help with c.out and html code

Posted by Shawn Bayern <ba...@essentially.net>.
On Mon, 30 Sep 2002, Steve Vanspall wrote:

> I want to use JSTL to do the same thing, but when I use <c:out
> value="${AdminProdAttrForm.genAttribs.html}">
> 
> I get the html code with the appropriate escape character encoding
> instead.
> 
> i.e. &lt; instead of < etc.
> 
> is there a way to stop the tag from escaping these characters??
> 
> any help would be appreciated.

Sure - set the 'escapeXml' attribute of <c:out> to 'false:

  <c:out
    value="${AdminProdAttrForm.genAttribs.html}"
    escapeXml="false" />

-- 
Shawn Bayern
"JSTL in Action"   http://www.jstlbook.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>