cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antonio Gallardo" <agalla...@agsoftware.dnsalias.com>
Subject Re: AW: XSP Redirection HELP!!!
Date Tue, 21 Jan 2003 02:03:02 GMT
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: cocoon-users-return-45030-m_rolappe=web.de@xml.apache.org
> [mailto:cocoon-users-return-45030-m_rolappe=web.de@xml.apache.org]Im
> Auftrag von Rajasekhar Atchutuni
> Gesendet: Dienstag, 21. Januar 2003 00:44
> An: cocoon-users@xml.apache.org
> 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:     <cocoon-users-unsubscribe@xml.apache.org>
> For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>




---------------------------------------------------------------------
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:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


Mime
View raw message