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: Struts 1.1 and Tiles
Date Tue, 19 Feb 2002 14:26:13 GMT

  Do you use appropriate ComponentActionServlet and TilesRequestProcessor (if Struts1.1) ?
If
not, specify the first in web.xml and second in struts-config.xml. Check tiles-doc or
struts-tiles example to know the syntax.

  If you write modified ForwardAction, I will make it available in the distribution.

    Cedric

Dave Weis wrote:

> On Tue, 19 Feb 2002, Cedric Dumoulin wrote:
> >   The normal way to use Tiles with Struts is to write your own action forwarding
to a
> > logical name. This logical name can be linked to a Tile definition name :
> >   <action     path="/test/testAction"
> >            type="org.apache.struts.example.tiles.test.TestActionTileAction">
> >       <forward  name="success"        path="test.struts.action"/>
> >       <forward  name="failure"           path="test.struts.action.fail"/>
> >   </action>
> >   Check examples coming with Tiles to know more.
>
> I have set up an action like this:
>
> public class DaveAction extends Action {
>     public ActionForward perform(ActionMapping mapping,
>                                  ActionForm form,
>                                  HttpServletRequest request,
>                                  HttpServletResponse response)
>         throws IOException, ServletException {
>         ActionErrors errors = new ActionErrors();
>         return (mapping.findForward("success"));
>     } // perform
> }
>
> With this in struts-config.xml
> <action path="/dave"
>         type="com.foo.test.DaveAction">
>         <forward name="success" path="forward.dave.test.page" />
> </action>
>
> and this is my componentDefinitions.xml
> <definition name="forward.dave.test.page" extends="mainLayout" >
>   <put name="title" value="Dave Testing" />
>   <put name="body" value="/dave.jsp" />
> </definition>
>
> But I still get a 500 error:
> java.lang.IllegalArgumentException: path must be
> absolute: `forward.dave.test.page'
>         at
> com.caucho.server.http.Application.getRequestDispatcher(Application.java:1805)
>         at
> org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:957)
>         at
> org.apache.struts.action.RequestProcessor.processActionForward(RequestProcessor.java:398)
>         at
> org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:263)
>         at
> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1049)
>         at
> org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:442)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:126)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:103)
>         at
> com.caucho.server.http.FilterChainServlet.doFilter(FilterChainServlet.java:82)
>         at com.caucho.server.http.Invocation.service(Invocation.java:272)
>         at
> com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:128)
>         at
> com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:216)
>         at
> com.caucho.server.http.HttpRequest.handleConnection(HttpRequest.java:158)
>         at com.caucho.server.TcpConnection.run(TcpConnection.java:140)
>         at java.lang.Thread.run(Thread.java:484)
>
> I'm using the resin servlet engine, so is there something in tiles that is
> specific to tomcat?
>
> >   The "org.apache.struts.actions.ForwardAction" do itself the forward to the page,
and
> > is actually not designed to run with Tiles. It is easy to write a similar class
to run
> > with Tiles : copy method processForward(...) in
> > org.apache.struts.tiles.ActionComponentServlet
> > to your new class. Copy method perform(...) from ForwardAction, and modify this
later
> > to call processForward(...) rather than doing rd.forward().
>
> If I write such a class, would you consider including it in the
> distribution? It is very useful, and would be even better with tiles.
>
> Thanks for the help
>
> dave
>
> > Dave Weis wrote:
> > > Hi Cedric
> > > I just downloaded tiles from your site and am proceeding to learn a few
> > > things. Is org.apache.struts.actions.ForwardAction updated to use the
> > > tiles functionality? I tried the line below and got an error:
> > >
> > > <action path="/admin/message/read"
> > >         type="org.apache.struts.actions.ForwardAction"
> > >         parameter="dave.test" />
> > >
> > > Error:
> > > java.lang.IllegalArgumentException: path must be absolute: `dave.test'
> > >
> > > Is this a known problem or am I doing something incorrectly?
> > >
> > > dave
> > >
> > > >
> > > > Dave Weis wrote:
> > > >
> > > > > How are the two shaping up? Are there still problems using a newer
version
> > > > > of struts with tiles? There are some features of 1.1 that I need
such as
> > > > > the dynamic forms. Also, would a nightly Struts download be in the
1.1
> > > > > series or will it be 1.0.2 with some additional fixes?
> > > > >
> > > > > Thanks
> > > > > dave
> > > > >
> > > > > --
> > > > > Dave Weis             "I believe there are more instances of the
abridgement
> > > > > djweis@sjdjweis.com   of the freedom of the people by gradual and
silent
> > > > >                       encroachments of those in power than by violent
> > > > >                       and sudden usurpations."- James Madison
> > > > >
> > > > > --
> > > > > 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>
> > > >
> > >
> > > --
> > > Dave Weis             "I believe there are more instances of the abridgement
> > > djweis@sjdjweis.com   of the freedom of the people by gradual and silent
> > >                       encroachments of those in power than by violent
> > >                       and sudden usurpations."- James Madison
> > >
> > > --
> > > 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>
> >
>
> --
> Dave Weis             "I believe there are more instances of the abridgement
> djweis@sjdjweis.com   of the freedom of the people by gradual and silent
>                       encroachments of those in power than by violent
>                       and sudden usurpations."- James Madison
>
> --
> 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