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 20:37:59 GMT
Donald Ball wrote:
> 
> On Wed, 18 Apr 2001, Berin Loritsch wrote:
> 
> > > 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?
> 
> that could be a solution, but then how would i distinguish between being
> unable to insert a row due to lack of data and being unable to insert a
> row due to a database error?

The other solution is to return values in the map that specify error, etc.
If only the Selectors let you expand values....  It would be great to do something
with the CodedSelector like this:

<map:act type="add-work">
  <map:select>
    <map:when test="&qout;data&quot.equals({error-type})">
      <map:redirect-to uri="insufficient-data.html"/>
    </map:when>
    <map:when test="&quot;jdbc&quot;.equals({error-type})">
      <map:redirect-to uri="database-error.html"/>
    </map:when>
    <map:otherwise>
      <map:redirect-to uri="success.html"/>
    </map:otherwise>
  </map:select>
</map:act>

Unfortunately, the sitemap doesn't expand test values.

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


Mime
View raw message