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] use examples for sendRedirect in xsp pages
Date Wed, 18 Apr 2001 17:03:58 GMT
Donald Ball wrote:
> 
> On Wed, 18 Apr 2001, Giacomo Pati wrote:
> 
> > > > okay, i've come up a scenarios where i think it would be very handy to
> > > be
> > > > able to issue redirects from xsp pages. suppose i have an action which
> > > > adds a row to a database table, and i need three pieces of information
> > > in
> > > > order to do the add. what i'd like to be able to do is link to the xsp
> > > > page along with whatever information i have. if i don't have all of
> > > the
> > > > information, the xsp page presents a form to capture the data i don't
> > > > already have; the form action url is the database action. if i already
> > > > have all of the information, though, i would like the xsp page to
> > > simply
> > > > redirect to the database action. make sense?
> > >
> > > Why do you let the xsp page take such decisions? It's part of you model
> > > to know if you have everything and thus the action will knows if you
> > > need the xsp page or not:
> > >
> > >   <act type="not-complete">
> > >     <redirect-to uri="more date"/>
> > >   </act>
> >
> > Sorry, this might not be the best solution to your problem, it was too early in
> > the morning to think about it :)
> 
> heh, i was just sitting down trying to puzzle out exactly what you meant.
> thing is, when i'm creating a link to the database record update url, i
> don't want to have to put in one url when i have all of the data and
> another when i don't - i want to link to one url and have it handle the
> extra data collection if necessary.
> 
> in c1, i would do this by writing an xsp page which did everything - the
> extra data collection and the database update and redirect. this solution
> requires xsp pages to be able to send redirects, but isn't optimal since
> i'm mixing form generation code and database update code in a single page.
> plus, i wanted to try out berin's sexy database actions.
> 
> so in c2, i figured i'd do as i outlined above - have an xsp page which
> serves as the master database update url, and have it post or redirect to
> the database action url when it has all of the data.
> 
> convincing? or stupid? you be the judge. :)

It sounds good.  So do you want to send a Map on successful insertion and
not when there is an error?

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


Mime
View raw message