You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Vince Marco <vm...@mac.com> on 2003/08/11 19:44:17 UTC

Quick way to insert HTML into a page??

I am looking for a quick way of inserting HTML into a page.  I know this 
sounds simple, but I have 50 image maps (one for each US state) that map 
out the counties in each state.  Longer term I am looking to create a 
component to handle this better, but I'd like a way to insert a given 
HTML template into a page given the state code (ie. given CO, include 
/WEB-INF/content/maps/CO.html) into my SelectCounty page.

There is nothing currently dynamic about the HTML.  The image map URLs 
point to the next page in the app.

I'm looking for an incredibly quick fix here.

Thanks,

Vince



RE: Quick way to insert HTML into a page??

Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
The IMarkupWriter interface has a printRaw() method, that is used for outputting raw markup (text
that includes '<', etc.).

You should be able to whip together a very small component that takes a state code as a parameter.
It can use that parameter to select a file containing the necessary markup, read it into memory, and
write it to the markup writer.  You should be able to make use of assets to help with the mapping of
state code to file.  You can easily add smarter caching later. Given that you already have the HTML
map files, it shouldn't take more than a few minutes to put it all together?

I think a component is the easiest way, but if you want, you could create an inner class on your
page that implements IRender and use the Delegator component that have the render() method on the
inner class invoked.  Again, take the plunge with a component ... it'll be a bit easier, and easier
to re-use later.

--
Howard M. Lewis Ship
Creator, Tapestry: Java Web Components
http://jakarta.apache.org/tapestry



> -----Original Message-----
> From: Vince Marco [mailto:vmarco@mac.com] 
> Sent: Monday, August 11, 2003 1:44 PM
> To: Tapestry users
> Subject: Quick way to insert HTML into a page??
> 
> 
> I am looking for a quick way of inserting HTML into a page.  
> I know this 
> sounds simple, but I have 50 image maps (one for each US 
> state) that map 
> out the counties in each state.  Longer term I am looking to create a 
> component to handle this better, but I'd like a way to insert a given 
> HTML template into a page given the state code (ie. given CO, include 
> /WEB-INF/content/maps/CO.html) into my SelectCounty page.
> 
> There is nothing currently dynamic about the HTML.  The image 
> map URLs 
> point to the next page in the app.
> 
> I'm looking for an incredibly quick fix here.
> 
> Thanks,
> 
> Vince
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>