Re: XSP Redirection HELP!!!
On 20.Jan.2003 -- 06:18 PM, Jim McCullough wrote: Don't know if this is what you are looking for but you can also use the sendRedirect (String url) of the HttpResponse object. Would look something like this: xsp:logic ((HttpResponse)response).sendRedirect (http://my_home_page;); /xsp:logic This is kinda clunky because it sends the response header back to the browser but it does the job from within XSP. There is also a logicsheet for that -- response.xsl. Please be aware that sending a redirect command to the client *after* any other data will cause an unpredictable result. This is because the output is not buffered and thus cannot be cancelled. It is almost impossible for the redirect to be the first data sent. So, I would strongly suggest not to do it. If you *do* want to update the database from an XSP, you have to merge all possible outcomes into one page. *I* would consider that extremely bad practice. HTH Chris. -- C h r i s t i a n H a u l [EMAIL PROTECTED] fingerprint: 99B0 1D9D 7919 644A 4837 7D73 FEF9 6856 335A 9E08 - 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]
XSP Redirection HELP!!!
Hi, I am using cocoon 2.0.3 with tomcat 4.1. In my xsl form submit I call an action that generates an xsp. The xsp writes the form data to sql; After this I need an auto redirect to the home page. How do I do this? Thanks for the help. Raj _ The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail - 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]
Re: XSP Redirection HELP!!!
Rajasekhar Atchutuni dijo: Hi, I am using cocoon 2.0.3 with tomcat 4.1. In my xsl form submit I call an action that generates an xsp. The xsp writes the form data to sql; After this I need an auto redirect to the home page. How do I do this? Thanks for the help. Raj Hi: I understand that you generate a request that use the XSP Generator. (Please, dont get me wrong here. I am just trying to explain what I understanded from your mail). If this is true You can change the pipeline to make the update to the SQL database using Database Actions (there are two flavors) and after sucessfull update, you redirect the page where you need it. Any Action is executed inmediately as they are readed from the sitemap. Please read between lines: before the selected pipeline is executed. For more info about Database Actions see: http://wiki.cocoondev.org/Wiki.jsp?page=DatabaseActions By the way, If you can, update to 2.0.4 that is more stable... Note: I dont know if Modular Database Actions works in 2.03 I think no, but check for some examples if this flavor of DB Actions are included or not. Original Database Actions are fine too. I hope It will helps you. Best Regards, Antonio Gallardo. _ The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail - 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]
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 Original Message Follows From: Antonio Gallardo [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: XSP Redirection HELP!!! Date: Mon, 20 Jan 2003 17:31:19 -0600 (CST) MIME-Version: 1.0 Received: from apache.org ([63.251.56.142]) by mc6-f24.law1.hotmail.com with Microsoft SMTPSVC(5.0.2195.5600); Mon, 20 Jan 2003 15:29:37 -0800 Received: (qmail 48698 invoked by uid 500); 20 Jan 2003 23:29:25 - Received: (qmail 48685 invoked from network); 20 Jan 2003 23:29:23 - Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm Precedence: bulk list-help: mailto:[EMAIL PROTECTED] list-unsubscribe: mailto:[EMAIL PROTECTED] list-post: mailto:[EMAIL PROTECTED] Delivered-To: mailing list [EMAIL PROTECTED] X-Authentication-Warning: ags01.agsoftware.dnsalias.com: apache set sender to [EMAIL PROTECTED] using -f Message-ID: [EMAIL PROTECTED] In-Reply-To: [EMAIL PROTECTED] References: [EMAIL PROTECTED] X-Priority: 3 Importance: Normal X-Mailer: SquirrelMail (version 1.2.9) X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Return-Path: [EMAIL PROTECTED] X-OriginalArrivalTime: 20 Jan 2003 23:29:37.0819 (UTC) FILETIME=[CC537EB0:01C2C0DB] Rajasekhar Atchutuni dijo: Hi, I am using cocoon 2.0.3 with tomcat 4.1. In my xsl form submit I call an action that generates an xsp. The xsp writes the form data to sql; After this I need an auto redirect to the home page. How do I do this? Thanks for the help. Raj Hi: I understand that you generate a request that use the XSP Generator. (Please, dont get me wrong here. I am just trying to explain what I understanded from your mail). If this is true You can change the pipeline to make the update to the SQL database using Database Actions (there are two flavors) and after sucessfull update, you redirect the page where you need it. Any Action is executed inmediately as they are readed from the sitemap. Please read between lines: before the selected pipeline is executed. For more info about Database Actions see: http://wiki.cocoondev.org/Wiki.jsp?page=DatabaseActions By the way, If you can, update to 2.0.4 that is more stable... Note: I dont know if Modular Database Actions works in 2.03 I think no, but check for some examples if this flavor of DB Actions are included or not. Original Database Actions are fine too. I hope It will helps you. Best Regards, Antonio Gallardo. _ The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail - 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] _ The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail - 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]
Re: XSP Redirection HELP!!!
Rajasekhar Atchutuni dijo: 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 Hi again! Yes, but in order to do that you need to use and action. Can you send the snip of your code? It is still dont clear to me. There are 2 approach: A- One page: ** 1 page that is always called and show the data (edit mode). B- more pages: ** 1 for show a clean form (insert) ** 1 for show the data in a filled form (edit mode) ** 1 for confirm Can you tell me what approach are you using? Antonio Gallardo Original Message Follows From: Antonio Gallardo [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: XSP Redirection HELP!!! Date: Mon, 20 Jan 2003 17:31:19 -0600 (CST) MIME-Version: 1.0 Received: from apache.org ([63.251.56.142]) by mc6-f24.law1.hotmail.com with Microsoft SMTPSVC(5.0.2195.5600); Mon, 20 Jan 2003 15:29:37 -0800 Received: (qmail 48698 invoked by uid 500); 20 Jan 2003 23:29:25 - Received: (qmail 48685 invoked from network); 20 Jan 2003 23:29:23 - Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm Precedence: bulk list-help: mailto:[EMAIL PROTECTED] list-unsubscribe: mailto:[EMAIL PROTECTED] list-post: mailto:[EMAIL PROTECTED] Delivered-To: mailing list [EMAIL PROTECTED] X-Authentication-Warning: ags01.agsoftware.dnsalias.com: apache set sender to [EMAIL PROTECTED] using -f Message-ID: [EMAIL PROTECTED] In-Reply-To: [EMAIL PROTECTED] References: [EMAIL PROTECTED] X-Priority: 3 Importance: Normal X-Mailer: SquirrelMail (version 1.2.9) X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Return-Path: [EMAIL PROTECTED] X-OriginalArrivalTime: 20 Jan 2003 23:29:37.0819 (UTC) FILETIME=[CC537EB0:01C2C0DB] Rajasekhar Atchutuni dijo: Hi, I am using cocoon 2.0.3 with tomcat 4.1. In my xsl form submit I call an action that generates an xsp. The xsp writes the form data to sql; After this I need an auto redirect to the home page. How do I do this? Thanks for the help. Raj Hi: I understand that you generate a request that use the XSP Generator. (Please, dont get me wrong here. I am just trying to explain what I understanded from your mail). If this is true You can change the pipeline to make the update to the SQL database using Database Actions (there are two flavors) and after sucessfull update, you redirect the page where you need it. Any Action is executed inmediately as they are readed from the sitemap. Please read between lines: before the selected pipeline is executed. For more info about Database Actions see: http://wiki.cocoondev.org/Wiki.jsp?page=DatabaseActions By the way, If you can, update to 2.0.4 that is more stable... Note: I dont know if Modular Database Actions works in 2.03 I think no, but check for some examples if this flavor of DB Actions are included or not. Original Database Actions are fine too. I hope It will helps you. Best Regards, Antonio Gallardo. _ The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail - 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] _ The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail - 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]
AW: XSP Redirection HELP!!!
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. 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. -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]
Re: AW: XSP Redirection HELP!!!
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]
AW: AW: XSP Redirection HELP!!!
well, it does work, I tried it out. only one generator per pipeline, that's right (only one generator can be set at pipeline setup time). but in this case, there is only one pipeline, that is the ServerPagesGenerator. the redirect is to another pipeline. anyway, I can imagine the use of XSP actions for prototyping (apart from generating and using XML fragments). -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]Im Auftrag von Antonio Gallardo Gesendet: Dienstag, 21. Januar 2003 03:03 An: [EMAIL PROTECTED] Betreff: Re: AW: XSP Redirection HELP!!! 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 - 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]
Re: XSP Redirection HELP!!!
Don't know if this is what you are looking for but you can also use the sendRedirect (String url) of the HttpResponse object. Would look something like this: xsp:logic ((HttpResponse)response).sendRedirect (http://my_home_page;); /xsp:logic This is kinda clunky because it sends the response header back to the browser but it does the job from within XSP. Jim Jim McCullough Risk Analytics Inc. - Las Vegas Software Engineering [EMAIL PROTECTED] [EMAIL PROTECTED] (702) 407-1814 (voice) (702) 407-1824 (fax) - Original Message - From: Rajasekhar Atchutuni [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, January 20, 2003 3:07 PM Subject: XSP Redirection HELP!!! Hi, I am using cocoon 2.0.3 with tomcat 4.1. In my xsl form submit I call an action that generates an xsp. The xsp writes the form data to sql; After this I need an auto redirect to the home page. How do I do this? Thanks for the help. Raj _ The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail - 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]
Re: AW: AW: XSP Redirection HELP!!!
Marco Rolappe dijo: well, it does work, I tried it out. only one generator per pipeline, that's right (only one generator can be set at pipeline setup time). but in this case, there is only one pipeline, that is the ServerPagesGenerator. the redirect is to another pipeline. Sorry I dont know and I think that as you told. This is a ugly solution. And I dont know if the code can be used in future releases of Cocoon. Anyway I recomend to use the correct approach. Solutions are always many, but we need to use the best. The Cocoon gurus said that the XSP-Action for databases is not the best: http://xml.apache.org/cocoon/userdocs/concepts/databases.html Actions are especially great for inserting, changing, or deleting data. Employing the pipeline-switching features of actions will simplify your pages. Such actions are concerned with only one view: either the success or failure of an operation. ESQL is great when reading data from a database. However, it is less attractive to use when it has to react to operation failures. This is due to the fact that it adds a layer of complexity to an XSP file, making it more difficult to understand and maintain. Best Regards, Antonio Gallardo anyway, I can imagine the use of XSP actions for prototyping (apart from generating and using XML fragments). -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]Im Auftrag von Antonio Gallardo Gesendet: Dienstag, 21. Januar 2003 03:03 An: [EMAIL PROTECTED] Betreff: Re: AW: XSP Redirection HELP!!! 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 - 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]