File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes problem with tiles in html:form Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "problem with tiles in html:form" Watch "problem with tiles in html:form" New topic
Author

problem with tiles in html:form

S Bhanu
Greenhorn

Joined: Feb 28, 2005
Posts: 15
I am using multiple struts tiles in html:form and the form is getting submitted more than once. See this:

javax.servlet.jsp.JspException: Exception forwarding for name error: javax.servlet.ServletException: Exception forwarding f
t.ServletException: Exception forwarding for name error: javax.servlet.ServletException: Exception forwarding for name erro
eption: Exception forwarding for name error: javax.servlet.ServletException: Exception forwarding for name error: javax.ser
ption forwarding for name error: javax.servlet.ServletException: Exception forwarding for name error: javax.servlet.Servlet
ding for name error: javax.servlet.ServletException: Exception forwarding for name error: javax.servlet.ServletException: E
e error: javax.servlet.ServletException: Exception forwarding for name error: javax.servlet.ServletException: Exception for
a.lang.IllegalStateException: Cannot forward a response that is already committed
at org.apache.struts.taglib.logic.ForwardTag.doForward(ForwardTag.java:127)
at org.apache.struts.taglib.logic.ForwardTag.doEndTag(ForwardTag.java:107)
at jsp_servlet._layout._jsp.__errors._jspService(__errors.java:166)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)


the code looks like this:
Layout.jsp
<html:form action="<%=request.getAttribute("fwdTo").toString() %>">
<tiles:insert name="header"/>
<tiles:insert name="navig"/>
<tiles:insert name="body"/>
<tiles:insert name="footer"/>
</html:html>

I need to mandatorily put all the elements in HTML in the form to submit. Is there any restriction in putting multiple tiles in html:form ?
Please note that I am using filer in the web.xml

[ March 02, 2006: Message edited by: Bshar ]
[ March 06, 2006: Message edited by: Bshar ]
S Bhanu
Greenhorn

Joined: Feb 28, 2005
Posts: 15
Can somebody explain what is worng with putting tiles inside html:form tag?
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
Using tiles:insert insert within a html:form tag works, as I have done this in a number of instances. I noticed looking at my code that I have used the format <tiles:insert component="XXX" /> but looking at the documentation it says that page, component and template are all equivalent.

Does one of your tiles have a logic:forward tag? That looks like the problem based on your stack trace.

- Brent
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem with tiles in html:form