Marco Rolappe dijo:
> are you using your xsp as an action via ServerPagesAction?
>
> are you using your xsp as the target for the form action? like this:
>
>       <form action="save-form-data" ...>
>
> in your sitemap:
>
>       <map:match pattern="save-form-data">
>               <map:generate type="serverpages" src="save-form-data.xsp"/>
>               ...
>       </map:match>
>
> you could redirect after the generation step via <map:redirect-to> but
> this is kind of ugly.

This will does not work because you have one generator in the pipeline. A
strict rule in any version af Cocoon told:

"Just ONE generator for pipeline"

then the another generator on the target of the redirection will not be
loaded. I think it will throw a Exception. (Gurus, please shine us and
tell us what will happen). I never tried to do somethig like this. See
more comments down.....

>
>
> another alternative would be to use your xsp via the already mentioned
> ServerPagesAction (if you must use xsp):
>
>       <form action="save-form-data" ...>
>
> in your sitemap:
>
>       <map:match pattern="save-form-data">
>               <map:act type="serverpages" src="save-form-data.xsp"/>
>               ...
>       </map:match>
>
> for this, you must have the serverpages action declared in the sitemap.
> then you can redirect via <map:redirect-to> in the sitemap or you can
> redirect from within the xsp via action:redirect-to (action logicsheet).
>
> third alternative would be to directly code the action, invoke it in
> your 'save-form-data' pipeline, after which you redirect.

I think this is a good aproach too. But I dont see why to waste a XSP when
any flavor of Database Action (Original or Modular) can do this for you.
Listen:

If you think you need your special XSP page because you need to validate
the form data that you received from the user request. The answer is:

Why reinvent the cool water? There is another fine action that can do this
for you, please check the following snip from my sitemap:

<!-- catalog of Table -->
<map:match pattern="*-table.html">
  <!-- Create -->
  <map:match type="request-parameter" pattern="cocoon-action-Create">
  <map:act action="crear" type="form-validator">
    <map:parameter name="descriptor" value="docs/{../1}-form.xml"/>
    <map:parameter name="validate-set" value="add"/>
<!-- Here data are safely validated -->
    <map:act type="dbAdd">
      <map:parameter name="descriptor" value="docs/{../../1}-form.xml"/>
<!-- At this point the data are already stored in the database -->
      <map:redirect-to uri="where_ever_you want"/>
    </map:act>
<!-- Here was wa problem. Data are not into the database, but validated -->
  </map:act>
<!-- Here Data are not passed the validation check -->
<!-- You can let it empty, since if no other pipeline match it, the handle
error will take care of what happened -->
</map:match>

For more info about form Validation Action, please check:

http://wiki.cocoondev.org/Wiki.jsp?page=FormValidationUsingCocoon

I hope it will help you. ;-)

Antonio Gallardo

>
> -----Ursprüngliche Nachricht-----
> Von: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]Im
> Auftrag von Rajasekhar Atchutuni
> Gesendet: Dienstag, 21. Januar 2003 00:44
> An: [EMAIL PROTECTED]
> Betreff: Re: XSP Redirection HELP!!!
>
>
> Hi,
>
> I am sorry I framed my question wrong.
>
> I am already successfully saving my form data to oracle using esql:query
> in my xsp page.
>
> What I need to know is how I can send/redirect the user to the home
> page, after I close the esql:connection.
>
> Thanks
> Raj
>
>
>
>
>
>
>
>
>
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail:     <[EMAIL PROTECTED]>
> For additional commands, e-mail:   <[EMAIL PROTECTED]>




---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>

Reply via email to