cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <blorit...@apache.org>
Subject Re: [c2] problem with actions
Date Wed, 18 Apr 2001 15:19:50 GMT
Martin Man wrote:
> 
> On Wed, Apr 18, 2001 at 08:36:47AM -0400, Berin Loritsch wrote:
> > Donald Ball wrote:
> > >
> > > okay, so i figured out and patched the problem i was having with the
> > > DatabaseAddAction (old JDBC driver), so naturally i'm on to something new.
> > > my sitemap has this rule:
> > >
> > > <map:match pattern="add/work">
> > >  <map:act type="add-work">
> > >   <parameter name="form-descriptor" value="context://resources/forms/work.xml"/>
> > >   <map:redirect-to uri="clients"/>
> > >  </map:act>
> > > </map:match>
> > >
> > > the action works fine, but the redirect doesn't occur. i end up with the
> > > good old 'Cocoon2 - Resource not found' error message. path-info is
> > > "add/work", not "clients" or even "add/clients". any clues?
> >
> > Does the Action return a Map object?  If not anything inside the Act
> > declaration is skipped.
> that's exactly the problem, DatabaseAddAction returns null no matter what the
> result was, shouldn't this be changed somhow ???

What would you like to see returned?  The idea of the Map object is to have
variables that you want to react to in the sitemap.  If your sitemap entry
were re-oriented, we won't have to return a Map object at all:

<map:match pattern="add/work">
  <map:act type="add-work">
    <parameter name="form-descriptor" value="context://resources/forms/work.xml"/>
  </map:act>
  <map:redirect-to uri="clients"/>
</map:match>

Notice that I moved the redirect outside the action?

If you need to react to specific information returned from the action, then
it makes sense to enclose the <map:redirect-to/> element in the <map:act/>
element.

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message