Returning servlet messages to form after submit

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

Returning servlet messages to form after submit

Stephanie Hall (TT)

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 application.

 

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
Reply | Threaded
Open this post in threaded view
|

RE: Returning servlet messages to form after submit

Stephanie Hall (TT)

Can anyone help me with this, please?  Do I need to replace an instance after the submission?  Or is there another way I can return messages to display?

 

From: Stephanie Hall (TT) [mailto:[hidden email]]
Sent: Friday, January 08, 2010 10:39 AM
To: [hidden email]
Subject: [ops-users] Returning servlet messages to form after submit

 

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 application.

 

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
Reply | Threaded
Open this post in threaded view
|

Re: Returning servlet messages to form after submit

Alessandro  Vernet
Administrator
In reply to this post by Stephanie Hall (TT)
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
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

RE: Re: Returning servlet messages to form after submit

Stephanie Hall (TT)
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
Reply | Threaded
Open this post in threaded view
|

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

Stephanie Hall (TT)
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
Reply | Threaded
Open this post in threaded view
|

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

Alessandro  Vernet
Administrator
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
Reply | Threaded
Open this post in threaded view
|

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

Stephanie Hall (TT)
Hi Alex,

That is exactly what I am looking for.  Thanks for all of your help!

Stephanie

-----Original Message-----
From: Alessandro Vernet [mailto:[hidden email]]
Sent: Sunday, January 17, 2010 4:09 AM
To: [hidden email]
Subject: [ops-users] Re: RE: RE: Re: Returning servlet messages to form after submit

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