You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Todd O'Bryan <to...@mac.com> on 2004/03/28 00:09:42 UTC

Displaying HTML with tags

I'm creating an application where people should be able to type (some) 
HTML tags in an input text field and then, when their input is 
displayed, safe tags (<b>, <i>, <code>, <pre>, <table>, <tr>, and <td> 
are all I think they'll need) should be delivered unmodified to the 
page so that they formatting they've created is respected. (Obviously, 
unsafe tags such as <script> should be delivered as &lt;script&gt; just 
as they are by default.)

How complicated is this going to be to do? It looks like I have to 
implement IMarkupWriter or subclass HTMLWriter to let my safe tags 
through, but although I see that the IPage.render() method has an 
IMarkupWriter argument so that you can direct rendered output to the 
appropriate place, I don't see where you can set the IMarkupWriter of a 
page. I'm probably just missing it...

TIA,
Todd


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


Re: Displaying HTML with tags

Posted by Marilen Corciovei <le...@nemesisit.rdsnet.ro>.
I have a component with renderComponent method overwritten which i use
for rendering html directly:

protected void renderComponent(IMarkupWriter iMarkupWriter,
IRequestCycle iRequestCycle) {
        iMarkupWriter.printRaw(htmlString);
}

but I think the "Insert" component with raw=true can perform the same
job.

Len

Marilen Aretius Corciovei
Independent J2EE, Linux consultant
http://nemesisit.rdsnet.ro/len
http://www.nemesisit.ro

On Sun, 2004-03-28 at 01:09, Todd O'Bryan wrote:

> I'm creating an application where people should be able to type (some) 
> HTML tags in an input text field and then, when their input is 
> displayed, safe tags (<b>, <i>, <code>, <pre>, <table>, <tr>, and <td> 
> are all I think they'll need) should be delivered unmodified to the 
> page so that they formatting they've created is respected. (Obviously, 
> unsafe tags such as <script> should be delivered as &lt;script&gt; just 
> as they are by default.)
> 
> How complicated is this going to be to do? It looks like I have to 
> implement IMarkupWriter or subclass HTMLWriter to let my safe tags 
> through, but although I see that the IPage.render() method has an 
> IMarkupWriter argument so that you can direct rendered output to the 
> appropriate place, I don't see where you can set the IMarkupWriter of a 
> page. I'm probably just missing it...
> 
> TIA,
> Todd
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
>