When I do this ...
<tiles:insert page="layout.jsp" flush="true"> ... <tiles:put name="body" value="/main.do?method=doInit" /> </tiles:insert>
I get the following error message: java.lang.IllegalStateException: Cannot forward after response has been committed
What am I doing wrong?
James' point is that if your servlet detects an error and you have a configured error page, then the servlet container will try to forward control to the error page. If some of your tiles have already begun writing output to the response, then you'll get this error.
In theory, the TilesRequestProcessor recognizes any Struts calls to "processForward" and takes care to do includes rather than forwards when the response is already committed. So, while I think it may be unorthodox to use an action to provide content for a tile, it might basically "work" in some cases.
However, this amounts to another form of "action chaining" with all the problems that pertain to that -- Struts is not designed to pass a single HttpServletRequest through the RequestProcessor more than once. There may be lots of unwelcome side effects.
It should be possible to reorganize your tiles and actions so that you only need to pass through one action to set up the request so that your tiles can be composed exclusively of JSPs. Have a look at the Controller interface (and ControllerSupport abstract class) -- it lets you write a bit of Tiles control logic that has access to the request, response, and ServletContext and you might be able to achieve what you need without triggering a whole second run through the request processor.
Maybe someone else has successfully used actions for tiles content -- but I suspect it's not a good long-term solution.
Joe
--
Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com "In fact, when I die, if I don't hear 'A Love Supreme,' I'll turn back; I'll know I'm in the wrong place."
- Carlos Santana
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]