struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ken Riley" <>
Subject [TILES] Problem using struts actions in tile's template
Date Tue, 22 Oct 2002 21:18:57 GMT
I'm probably being dense here (not an uncommon occurance) but I seem to be unable to 
create a tile layout that uses multiple actions. I have a sample below that I'm using to 
test. When I run this, I don't get any output for the action call. Ultimately I
like to have a layout that calls 4 or 5 actions but I'd like to get my test app working first

<?xml version="1.0" encoding="ISO-8859-1" ?>

<!DOCTYPE struts-config PUBLIC
          "-//Apache Software Foundation//DTD Struts Configuration 1.0//EN"

    <action    path="/header"
		<forward name="success" path="/jsp/header.jsp"/>              
    <action    path="/content"
		<forward name="success" path="/jsp/content.jsp"/>              
-------END struts-config.xml-----

<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
<tiles:insert template="/template.jsp">
    <tiles:put name="title" content="Service Address" direct="true" />
    <tiles:put name="header" content="/" />
    <tiles:put name="content" content="/"/>
------END temptest.jsp-----------

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>

<head><title><tiles:get name="title"/></title>
<table align="left" width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td><tiles:get name="header" /></td></tr>
   <table border="0" cellspacing="0" cellpadding="0" width="100%">
   <td><tiles:get name="content"/></td>

------END template.jsp-----------

<h3>THIS IS THE HEADER!!!!</h3>
------END header.jsp-------------

------END content.jsp------------

Note:HeaderAction and ContentAction are identical except for their name. just used for testing
package com.mycompany.test;

import org.apache.struts.action.*;
import javax.servlet.http.*;
import javax.servlet.*;

public class ContentAction extends Action {

    public ActionForward perform(ActionMapping mapping,
                 ActionForm form,
                 HttpServletRequest request,
                 HttpServletResponse response)
    throws IOException, ServletException {

        return mapping.findForward("success");  


The output I get (Struts 1.1b2/Tomcat 4.1.12)
[Exception in:/] Cannot forward after response has been committed   
[Exception in:/] Cannot forward after response has been committed  

Thanks for any help/suggestions! 

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message