views:

63

answers:

1

Hi,

I've set up my servlet to get invoked through a struts action and the result is that it writes html to the screen. However, I'm using a template system (lets say header, content, footer) and would only like to write to the content title ie. keep the header and footer.

Does anybody know if this is possible?

Thanks, Gearoid.

A: 

You can either divide your output to 3 procedures, which mb are getHeader(), getContent() and getFooter(), and then write your output only in getContent(). Or you can use JSP includes, and write to include jsps: header.jsp and footer.jsp, and, while generating content output, just include this jsps. I would prefer second way to do it.

UPDATE: maybe this one can help you: Struts tiling

Yurish
Thanks for the reply but this solution wouldn't work if I wanted to keep other parts of the template dynamic.Ideally I would like to just point a tile at the servlet url from the tiles-def or something equivalent. Any ideas?
Gearóid