You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Struts Newsgroup (@Basebeans.com)" <st...@basebeans.com> on 2002/08/05 20:25:03 UTC

Re: Struts' Template

Subject: Re: Struts' Template
From: "Abhinandan Karmakar" <ak...@hotmail.com>
 ===
I also use templates and a similar problem earlier. What I did was, I took
away all error handling responsibility from the JSP and gave it to a Action
Bean.

What I do generally is I point all "sensitive" links to an Action bean.
Which can do any amount of forwarding :-)

Hope this keeps you going.

Abhinandan Karmakar.

"Harden ZHU" <ha...@sympatico.ca> wrote in message
news:mailman.1005666120.4254.struts@basebeans.com...
> My error page is constructed same way. But in viewcart.jsp (<template:put
> name='content' content='/viewcart.jsp' />), when I do forward I got follow
> error message:
> ================================================
> Tue Nov 13 10:31:48 EST 2001:<E> <WebAppServletContext-commerce> Root
cause
> of ServletException javax.servlet.jsp.JspException: Cannot forward a
> response that is already committed
> ================================================
> So where people put their error checking? In the main page jsp or subpage
> jsp? I am sure it is not template.jsp.
>
> Harden
>
>
> ----- Original Message -----
> From: "Marcel Andres" <ma...@csfs.com>
> To: "struts-user" <st...@jakarta.apache.org>
> Sent: Tuesday, November 13, 2001 4:41 AM
> Subject: RE: Struts' Template
>
>
> > Isn't it possible for you, to create the error page in the same way? You
> could include title.jsp, header.jsp etc. on the error page, too, and so it
> would not be a problem to forward to this page.
> >
> > Marcel
> >
> > -----Original Message-----
> > From: hardenz@sympatico.ca [mailto:hardenz@sympatico.ca]
> > Sent: Tuesday, November 13, 2001 10:17 AM
> > To: struts-dev@jakarta.apache.org; struts-user@jakarta.apache.org
> > Subject: Struts' Template
> >
> >
> > Hi,
> >
> > I am using the template as follow. And viewcart.jsp is the content. In
> > viewcart.jsp, I have error checking. If found errors, will be forward to
> > another page. But I can't do forward, beacuse title.jsp, header.jsp etc
> are
> > included first. JSP will flush the code when do include. I don't want to
> put
> > error checking at follow instead of viewcard.jsp. So what I should do?
Any
> > suggestion or good pattern for this kind situation?
> >
> > Thanks
> >
> > Harden
> >
> > ====================================================
> >  <%@ taglib uri='/WEB-INF/tlds/struts-template.tld' prefix='template' %>
> >
> > <template:insert template='/template.jsp'>
> > <template:put name='title' content='title.jsp' />
> > <template:put name='header' content='/header.jsp' />
> > <template:put name='mainmenu' content='/mainmenu.jsp' />
> > <template:put name='sidebar' content='/sidebar.jsp' />
> > <template:put name='content' content='/viewcart.jsp' />
> > <template:put name='footer' content='/footer.jsp' />
> > </template:insert>
> > ====================================================
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> >
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>