Login  Register

Re: RE: RE: Re: Returning servlet messages to form after submit

Posted by Alessandro Vernet on Jan 17, 2010; 10:09am
URL: https://discuss.orbeon.com/Returning-servlet-messages-to-form-after-submit-tp1009797p1015976.html

Stephanie,

Are you saying that the service is returning and HTTP error code,  
hence de xforms-submit-error, but it is also giving you in the body of  
the response an XML document with more information about what  
happened? If that is the case, you can access that document with event
('response-body') in your action listening on xforms-submit-error.  
Then you can use an xforms:insert if you wish to store that document  
in an instance. Would that work for you?

Alex



On Jan 15, 2010, at 10:40 AM, "Stephanie Hall (TT)" <[hidden email]
 > wrote:

> There's no way to do the replace if the submission will throw the  
> xforms-submit-error, is there?  That's primarily what I want to use  
> it for: letting the user know a project name already exists, etc, so  
> I want to stop the submission but replace the instance to let them  
> know there's a problem. I've got a workaround though, if there's no  
> support for this now.
>
>
> -----Original Message-----
> From: Stephanie Hall (TT)  
> [mailto:[hidden email]]
> Sent: Friday, January 15, 2010 8:35 AM
> To: [hidden email]
> Subject: [ops-users] RE: Re: Returning servlet messages to form  
> after submit
>
> Thank you, Alex. That was what I was thinking, but I wasn't sure.
>
> -----Original Message-----
> From: Alessandro Vernet [mailto:[hidden email]]
> Sent: Thursday, January 14, 2010 9:16 PM
> To: [hidden email]
> Subject: [ops-users] Re: Returning servlet messages to form after  
> submit
>
> Stephanie,
>
> Yes, typically you'll call the servlet from XForms using an  
> xforms:submission replace="instance". So you'll send XML to the  
> servlet, and get XML back. You store the XML you receive in another  
> instance, and decide what to do next based on what you got, like  
> maybe display an error message which is inside the payload returned  
> by the servlet.
>
> Alex
>
>
>
> On Jan 8, 2010, at 8:39 AM, "Stephanie Hall (TT)" <[hidden email]
>> wrote:
>
>> Hi all, it’s me again.
>>
>>
>>
>> I’ve searched the website and archives and I couldn’t find the  
>> answer
>> to this, so hopefully someone here can tell me how to do this  or
>> point me to where the answer is if I missed it:
>>
>>
>>
>> I’ve got a separate deployment scheme running in Java w/ tomcat,  
>> and
>> my form JSPs call a servlet that acts as the brain of the applicati
>> on.
>>
>>
>>
>> In one of my forms, the user hits submit, some stuff happens in the
>> servlet, and I want to display the result message of that servlet
>> stuff in the form (successfully saved to system or failed to save,
>> stuff like that).  Only the servlet will know what happened.  How  
>> do I
>> best go about this?  I’d like to avoid using xpl if possible.
>>
>>
>>
>> Thanks,
>>
>> Stephanie
>>
>>
>> --
>> 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
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet