sendredirect/dispatcher in separate deployment war servlet not happening after submission

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

sendredirect/dispatcher in separate deployment war servlet not happening after submission

npujol73

Hi,

 I have a xform:submission element of type replace="all" that submits
to a servlet in a separate war. The servlet gets called and the data
passed just fine but
I cannot get the servlet to sendredirect or dispatch to another page.
The page comes back blank with this url :
http://localhost:8080/onlineForm/orbeon/xforms-server-submit.
Can anybody help?

Here is my submission element

  <xforms:submission id="save-cand-data" validate="false"
method="post"
action="http://localhost:8080/onlineForm/xforms/FetchForm?op=save"
replace="all" ref="instance('fr-metadata')">

Here is the relevant servlet code

public void doPost(......)
{
               final OAPersister persister = new OAPersister(service,
neededTables);
               persister.saveForm(req.getReader());
               res.sendRedirect("http://www.yahoo.com");
              //RequestDispatcher dispatcher=
req.getRequestDispatcher("/onlineForm/submitOk.html");
}

Thanks in advance for any feedback


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: sendredirect/dispatcher in separate deployment war servlet not happening after submission

Erik Bruchez-3
I cannot be 100% sure without trying but I suspect that this is because OrbeonXFormsFilter does not handle redirects. Maybe you could look into fixing this in:

http://github.com/orbeon/orbeon-forms/blob/development/src/java/org/orbeon/oxf/servlet/OrbeonXFormsFilter.java

-Erik

On Sat, Oct 24, 2009 at 11:22 PM, <[hidden email]> wrote:

Hi,

 I have a xform:submission element of type replace="all" that submits
to a servlet in a separate war. The servlet gets called and the data
passed just fine but
I cannot get the servlet to sendredirect or dispatch to another page.
The page comes back blank with this url :
http://localhost:8080/onlineForm/orbeon/xforms-server-submit.
Can anybody help?

Here is my submission element

 <xforms:submission id="save-cand-data" validate="false"
method="post"
action="http://localhost:8080/onlineForm/xforms/FetchForm?op=save"
replace="all" ref="instance('fr-metadata')">

Here is the relevant servlet code

public void doPost(......)
{
              final OAPersister persister = new OAPersister(service,
neededTables);
              persister.saveForm(req.getReader());
              res.sendRedirect("http://www.yahoo.com");
             //RequestDispatcher dispatcher=
req.getRequestDispatcher("/onlineForm/submitOk.html");
}

Thanks in advance for any feedback


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: sendredirect/dispatcher in separate deployment war servlet not happening after submission

Alessandro  Vernet
Administrator
In reply to this post by npujol73
On Sat, Oct 24, 2009 at 11:22 PM,  <[hidden email]> wrote:
>  I have a xform:submission element of type replace="all" that submits
> to a servlet in a separate war. The servlet gets called and the data
> passed just fine but
> I cannot get the servlet to sendredirect or dispatch to another page.
> The page comes back blank with this url :
> http://localhost:8080/onlineForm/orbeon/xforms-server-submit.
> Can anybody help?

Also, instead of doing a submission replace="all" to your servlet that
does a redirect, you could do a submission replace="instance" to your
servlet that returns an XML element with the URL to go to, and you go
to that URL in XForms with an xforms:load.

Alex
--
Orbeon Forms - Web forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
My Twitter: http://twitter.com/avernet


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Re: sendredirect/dispatcher in separate deployment war servlet not happening after submission

npujol73
Hi Alex,

 Can you point me to an example that would show how to respond to the
event triggered by the submission in order to automatically trigger
the xforms:load ?

Thanks!

On Mon, Oct 26, 2009 at 8:43 PM, Alessandro Vernet <[hidden email]> wrote:

> On Sat, Oct 24, 2009 at 11:22 PM,  <[hidden email]> wrote:
>>  I have a xform:submission element of type replace="all" that submits
>> to a servlet in a separate war. The servlet gets called and the data
>> passed just fine but
>> I cannot get the servlet to sendredirect or dispatch to another page.
>> The page comes back blank with this url :
>> http://localhost:8080/onlineForm/orbeon/xforms-server-submit.
>> Can anybody help?
>
> Also, instead of doing a submission replace="all" to your servlet that
> does a redirect, you could do a submission replace="instance" to your
> servlet that returns an XML element with the URL to go to, and you go
> to that URL in XForms with an xforms:load.
>
> Alex
> --
> Orbeon Forms - Web forms, open-source, for the Enterprise
> Orbeon's Blog: http://www.orbeon.com/blog/
> My Twitter: http://twitter.com/avernet
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
>
>


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: sendredirect/dispatcher in separate deployment war servlet not happening after submission

Markku Laine
Nicolas,


Try this (might contain typos/has not been tested):
<xforms:instance id="your-instance-for-the-redirect-url">
     <dummy xmlns="" />
</xforms:instance>
<xforms:submission id="your-submission" replace="instance"  
instance="your-instance-for-the-redirect-url" ...>
     <xforms:load resource="instance( 'your-instance-for-the-redirect-
url' )" ev:event="xforms-submit-done" />
</xforms:submission>

Regards


-Markku

On 27.10.2009, at 17.09, Nicolas Pujol wrote:

> Hi Alex,
>
> Can you point me to an example that would show how to respond to the
> event triggered by the submission in order to automatically trigger
> the xforms:load ?
>
> Thanks!
>
> On Mon, Oct 26, 2009 at 8:43 PM, Alessandro Vernet  
> <[hidden email]> wrote:
>> On Sat, Oct 24, 2009 at 11:22 PM,  <[hidden email]> wrote:
>>>  I have a xform:submission element of type replace="all" that  
>>> submits
>>> to a servlet in a separate war. The servlet gets called and the data
>>> passed just fine but
>>> I cannot get the servlet to sendredirect or dispatch to another  
>>> page.
>>> The page comes back blank with this url :
>>> http://localhost:8080/onlineForm/orbeon/xforms-server-submit.
>>> Can anybody help?
>>
>> Also, instead of doing a submission replace="all" to your servlet  
>> that
>> does a redirect, you could do a submission replace="instance" to your
>> servlet that returns an XML element with the URL to go to, and you go
>> to that URL in XForms with an xforms:load.
>>
>> Alex
>> --
>> Orbeon Forms - Web forms, open-source, for the Enterprise
>> Orbeon's Blog: http://www.orbeon.com/blog/
>> My Twitter: http://twitter.com/avernet
>>
>>
>> --
>> You receive this message as a subscriber of the [hidden email]  
>> mailing list.
>> To unsubscribe: mailto:[hidden email]
>> For general help: mailto:[hidden email]?subject=help
>> OW2 mailing lists service home page: http://www.ow2.org/wws
>>
>>
>
> --
> You receive this message as a subscriber of the [hidden email]  
> mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws