struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cedric Dumoulin <cedric.dumou...@lifl.fr>
Subject Re: Can anyone help on this?
Date Fri, 16 Nov 2001 10:05:42 GMT

  I think you can't call an action as template region. The problem come from JSP
: you can't do a "forward" or "sendRedirect" once you have start written
something in output. Your action probably do a forward, but as you have already
written something in header, sidebar, ..., this cause an exception.

  Try to use Tiles library instead of templates. Think of it as an "extended
templates" library. You don't need to change your pages, just download tiles.jar
(or tilesForStruts1.0.jar), and instruct your web server to use "tiles.tld"
instead of "struts-template.tld". This is done by adding or changing following
line in your web.xml :

  <taglib>
    <taglib-uri>/WEB-INF/struts-template.tld</taglib-uri> <!-- logical name
used
in your jsp file --!>
    <taglib-location>/WEB-INF/tiles.tld</taglib-location>  <!-- real uri of
tiles.tld --!>
  </taglib>


   Hope this help,

    Cedric

Konstantina Stamopoulou wrote:

> Well Tom I think you are right.
> The input I gave you was insufficient so here is all the story.
>
> THE .JSP USING THE TEMPLATE
> <template:insert template='/chapterTemplate.jsp'>
>    <template:put name='header' content='/company.html' />
>     <template:put name='sidebar' content='/sidebar.jsp' />
>     <template:put name='content' content='/test.do'/>
>     <template:put name='footer' content='/footer.html'/>
> </template:insert>
>
> THE ERROR
>
> Included servlet error: 500
> Location: /template-dina/company.jsp
> Error Location: /template-dina/test.do
>
> Root cause:
> javax.servlet.jsp.JspException: Servlet Exception
>  at org.apache.struts.taglib.template.InsertTag.doEndTag(InsertTag.java:149)
>  at
> _0002fcompany_0002ejspcompany_jsp_4._jspService(_0002fcompany_0002ejspcompan
> y_jsp_4.java:221)
>  at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>  at
> org.apache.jasper.servlet.JspServlet$JspCountedServlet.service(JspServlet.ja
> va:130)
>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>  at
> org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
> va:282)
>  at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:429)
>  at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:500)
>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>  at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
>  at org.apache.tomcat.core.Handler.service(Handler.java:287)
>  at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
>  at
> org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:81
> 2)
>  at org.apache.tomcat.core.ContextManager.service(ContextManager.java:758)
>  at
> org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
> onnectionHandler.java:213)
>  at
> org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
>  at
> org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
>  at java.lang.Thread.run(Thread.java:484)
>
> I really appreciate your help.
>
> ----- Original Message -----
> From: "Tom Klaasen (TeleRelay)" <tom.klaasen@telerelay.com>
> To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
> Sent: Friday, November 16, 2001 11:09 AM
> Subject: RE: Can anyone help on this?
>
> > Hard to answer this one, isn't it?
> >
> > First of all, maybe others on the list can get something out of the root
> > cause but are frustrated now because you obviously don't want to show
> > it.
> >
> > Secondly, _how_ do you "call the .do file"? Showing us a snippet of your
> > page could help narrow down the guessing work.
> >
> > Thirdly, I don't see any reason why a .do file could not be used in a
> > template tag (supposing you mean the "insert" tag), since the tag asks
> > for a URI. But I could be wrong on this one.
> >
> >
> > tomK
> >
> >
> > > -----Original Message-----
> > > From: Konstantina Stamopoulou [mailto:stak@intracom.gr]
> > > Sent: vrijdag 16 november 2001 9:33
> > > To: Struts Users Mailing List
> > > Subject: Re: Can anyone help on this?
> > >
> > >
> > > Thanx for the advice Tom but I couldn't get much from the error.
> > > What I did was to to call the .do file and forward the
> > > control to the .jsp
> > > that uses the template.
> > > Generally, is it illegal to use .do files within a template tag??
> > >
> > > Thanx again,
> > > Konstantina
> > >
> > >
> > > ----- Original Message -----
> > > From: "Tom Klaasen (TeleRelay)" <tom.klaasen@telerelay.com>
> > > To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
> > > Sent: Thursday, November 15, 2001 4:06 PM
> > > Subject: RE: Can anyone help on this?
> > >
> > >
> > > > look further down the stack trace, starting from the line
> > > "Root cause".
> > > > This might give you something more to work with ...
> > > >
> > > > hth,
> > > > tomK
> > > >
> > > > > -----Original Message-----
> > > > > From: Konstantina Stamopoulou [mailto:stak@intracom.gr]
> > > > > Sent: donderdag 15 november 2001 12:56
> > > > > To: Struts Users Mailing List
> > > > > Subject: Can anyone help on this?
> > > > >
> > > > >
> > > > > Hello,
> > > > > I'm using a template for my application and for the main
> > > > > content I want to display a table from a database.
> > > > > When I access the database.do using a URL I get all the data
> > > > > correctly.
> > > > > When I use this database.do file in the .jsp that uses the
> > > > > template I get :
> > > > >
> > > > > javax.servlet.ServletException: Servlet Exception
> > > > > at
> > > > > org.apache.jasper.runtime.PageContextImpl.handlePageException(
> > > > > PageContextImpl.java:459)
> > > > > at
> > > > > _0002fcompany_0002ejspcompany_jsp_3._jspService(_0002fcompany_
> > > > > 0002ejspcompany_jsp_3.java:234)
> > > > > at
> > > > >
> > > org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
> > > > >
> > > > >
> > > > > How should I handle this error?
> > > > >
> > > > > Thanx in advance.
> > > > >
> > > >
> > > > --
> > > > To unsubscribe, e-mail:
> > > <mailto:struts-user-unsubscribe@jakarta.apache.org>
> > > > For additional commands, e-mail:
> > > <mailto:struts-user-help@jakarta.apache.org>
> > > >
> > > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > > <mailto:struts-user-> unsubscribe@jakarta.apache.org>
> > > For
> > > additional commands,
> > > e-mail: <mailto:struts-user-help@jakarta.apache.org>
> > >
> > >
> >
> > --
> > To unsubscribe, e-mail:
> <mailto:struts-user-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
> <mailto:struts-user-help@jakarta.apache.org>
> >
> >
>
> --
> To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message