Servlet and XForms

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

Servlet and XForms

Chaminda
Hi Folks,
 
Im new to both technology and the mailling list.
 
Can you guys to explain or give any example about how can i send a request to a servlet ?
 
Ur help highly appriciate

--
Chaminda Amarasinghe,
 


--
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: Servlet and XForms

Erik Bruchez
Administrator
Chaminda,

It depends on the type of request. If it's just an HTTP GET (i.e. a
client-side redirect), you can use either xforms:load or
xforms:submission. If you want to POST to a servlet, then you use
xforms:submission.

What does your servlet expect as input, and what does it produce as output?

-Erik

Chaminda Amarasinghe wrote:

> Hi Folks,
>  
> Im new to both technology and the mailling list.
>  
> Can you guys to explain or give any example about how can i send a
> request to a servlet ?
>  
> Ur help highly appriciate
>
> --
> Chaminda Amarasinghe,
>  
>

--
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.com/


--
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: Servlet and XForms

Chaminda
 
Hi Erik,
 
Many thanks for taking your time to reply,
 
This is what I need?
 
1) Web Client types the url (HTTP GET)in browser's address box
2) The request goes to a Servlet (Say SarvletX).
3) ServletX despatch the request to a XForm(Not sure its possible or not)
4) That XForm consist with XForm model, Say Employee with ID and Name,
5) Web Client fill the Employee ID and Name,
6) Web Client post the XFrom by clicking "Submit"
7) This XForm submission goes to a servlet (say ServletY),
8) ServletY gets XForm Model and creates Java Object
 
I think my explanation is clear. Sorry for my english
 
Your kind concern in this regards highly appreciate.
 
 
Thanks

 
On 11/14/07, Erik Bruchez <[hidden email]> wrote:
Chaminda,

It depends on the type of request. If it's just an HTTP GET (i.e. a
client-side redirect), you can use either xforms:load or
xforms:submission. If you want to POST to a servlet, then you use
xforms:submission.

What does your servlet expect as input, and what does it produce as output?

-Erik

Chaminda Amarasinghe wrote:

> Hi Folks,
>
> Im new to both technology and the mailling list.
>
> Can you guys to explain or give any example about how can i send a
> request to a servlet ?
>
> Ur help highly appriciate
>
> --
> Chaminda Amarasinghe,
>
>


--
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.com/


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




--
Chaminda Amarasinghe,
Software Engineer,
EFutures (pvt) Ltd,
No 46 ½, Castle Street,
Colombo 08
Sri Lanka
Voice
        +94 773 538 238 (Mob)
        +94 115 333 633 (Off)
        +94 372 247 051 (Res)

--
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: Servlet and XForms

Chaminda
Hi
 
Can anyone send me a working project (very simple like hello world) that has deployed as a separate war,
 
Thanks
Chamida

 
On 11/14/07, Chaminda Amarasinghe <[hidden email]> wrote:
 
Hi Erik,
 
Many thanks for taking your time to reply,
 
This is what I need?
 
1) Web Client types the url (HTTP GET)in browser's address box
2) The request goes to a Servlet (Say SarvletX).
3) ServletX despatch the request to a XForm(Not sure its possible or not)
4) That XForm consist with XForm model, Say Employee with ID and Name,
5) Web Client fill the Employee ID and Name,
6) Web Client post the XFrom by clicking "Submit"
7) This XForm submission goes to a servlet (say ServletY),
8) ServletY gets XForm Model and creates Java Object
 
I think my explanation is clear. Sorry for my english
 
Your kind concern in this regards highly appreciate.
 
 
Thanks

 
On 11/14/07, Erik Bruchez <[hidden email]> wrote:
Chaminda,

It depends on the type of request. If it's just an HTTP GET (i.e. a
client-side redirect), you can use either xforms:load or
xforms:submission. If you want to POST to a servlet, then you use
xforms:submission.

What does your servlet expect as input, and what does it produce as output?

-Erik

Chaminda Amarasinghe wrote:

> Hi Folks,
>
> Im new to both technology and the mailling list.
>
> Can you guys to explain or give any example about how can i send a
> request to a servlet ?
>
> Ur help highly appriciate
>
> --
> Chaminda Amarasinghe,
>
>


--
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.orbeon.com/" target="_blank">http://www.orbeon.com/


--
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: <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.ow2.org/wws" target="_blank">http://www.ow2.org/wws




--
Chaminda Amarasinghe,
Software Engineer,
EFutures (pvt) Ltd,
No 46 ½, Castle Street,
Colombo 08
Sri Lanka
Voice
        +94 773 538 238 (Mob)
        +94 115 333 633 (Off)
        +94 372 247 051 (Res)



--
Chaminda Amarasinghe,
Software Engineer,
EFutures (pvt) Ltd,
No 46 ½, Castle Street,
Colombo 08
Sri Lanka
Voice
        +94 773 538 238 (Mob)
        +94 115 333 633 (Off)
        +94 372 247 051 (Res)

--
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: Servlet and XForms

Erik Bruchez
Administrator
In reply to this post by Chaminda
Chaminda Amarasinghe wrote:
>  
> Hi Erik,
>  
> Many thanks for taking your time to reply,
>  
> This is what I need?
>  
> 1) Web Client types the url (HTTP GET)in browser's address box
> 2) The request goes to a Servlet (Say SarvletX).

So far so good.

> 3) ServletX despatch the request to a XForm(Not sure its possible or not)

How does it dispatch it? With a client-side redirect? With a server-side
forward? What seems to matter here is: what kind of information does
your servlet want to pass to the XForms page?

> 4) That XForm consist with XForm model, Say Employee with ID and Name,
> 5) Web Client fill the Employee ID and Name,
> 6) Web Client post the XFrom by clicking "Submit"

No problem here.

> 7) This XForm submission goes to a servlet (say ServletY),

I don't see a problem here.

> 8) ServletY gets XForm Model and creates Java Object

Technically, XForms submits XML "instances", not "models". An instance
is just an XML document, but a model can contain several instances,
submissions, bindings, etc.

-Erik

--
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.com/


--
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: Servlet and XForms

Chaminda


On 11/15/07, Erik Bruchez <[hidden email]> wrote:
Chaminda Amarasinghe wrote:
>
> Hi Erik,
>
> Many thanks for taking your time to reply,
>
> This is what I need?
>
> 1) Web Client types the url (HTTP GET)in browser's address box
> 2) The request goes to a Servlet (Say SarvletX).

So far so good.

> 3) ServletX despatch the request to a XForm(Not sure its possible or not)

How does it dispatch it? With a client-side redirect? With a server-side
forward? What seems to matter here is: what kind of information does
your servlet want to pass to the XForms page?
 
This is server side forward, Servlet stores attributes in request scope and these attributes are needed to populate in the XForm.
 
something like this

// Can we dispatch a xhtml like this?

RequestDispatcher d= request.getRequestDispatcher("/view.xhtml");

request.setAttribute("dep.names", "list_of_deparments")

d.forward(request, response);


> 4) That XForm consist with XForm model, Say Employee with ID and Name,
> 5) Web Client fill the Employee ID and Name,
> 6) Web Client post the XFrom by clicking "Submit"

No problem here.

> 7) This XForm submission goes to a servlet (say ServletY),

I don't see a problem here.

> 8) ServletY gets XForm Model and creates Java Object

Technically, XForms submits XML "instances", not "models". An instance
is just an XML document, but a model can contain several instances,
submissions, bindings, etc.

-Erik

--
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.com/


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




--
Chaminda Amarasinghe,
Software Engineer,
EFutures (pvt) Ltd,
No 46 ½, Castle Street,
Colombo 08
Sri Lanka
Voice
        +94 773 538 238 (Mob)
        +94 115 333 633 (Off)
        +94 372 247 051 (Res)

--
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: Servlet and XForms

Naveen Ayyagari-2
In reply to this post by Chaminda
I am also having difficulties getting an application deployed as a separate WAR file to function with Orbeon. I have
been able to use the filter-mapping to process the xform into html, but on submission I am having issues. I do not seem
to be able to obtain the instance XML of a summited form in a servlet..  I am sure I just don't have something
configured correctly, but the request at the servlet is empty with no instance xml.

A simple sample xform that uses the separate deployment method would make this much easier to figure out.

Any help is greatly appreciated.

Thanks
--Naveen

Chaminda Amarasinghe wrote:

> Hi
>  
> Can anyone send me a working project (very simple like hello world) that
> has deployed as a separate war,
>  
> Thanks
> Chamida
>
>  
> On 11/14/07, *Chaminda Amarasinghe* <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>      
>     Hi Erik,
>      
>     Many thanks for taking your time to reply,
>      
>     This is what I need?
>      
>     1) Web Client types the url (HTTP GET)in browser's address box
>     2) The request goes to a Servlet (Say SarvletX).
>     3) ServletX despatch the request to a XForm(Not sure its possible or
>     not)
>     4) That XForm consist with XForm model, Say Employee with ID and Name,
>     5) Web Client fill the Employee ID and Name,
>     6) Web Client post the XFrom by clicking "Submit"
>     7) This XForm submission goes to a servlet (say ServletY),
>     8) ServletY gets XForm Model and creates Java Object
>      
>     I think my explanation is clear. Sorry for my english
>      
>     Your kind concern in this regards highly appreciate.
>      
>      
>     Thanks
>
>      
>     On 11/14/07, *Erik Bruchez* < [hidden email]
>     <mailto:[hidden email]>> wrote:
>
>         Chaminda,
>
>         It depends on the type of request. If it's just an HTTP GET (i.e. a
>         client-side redirect), you can use either xforms:load or
>         xforms:submission. If you want to POST to a servlet, then you use
>         xforms:submission.
>
>         What does your servlet expect as input, and what does it produce
>         as output?
>
>         -Erik
>
>         Chaminda Amarasinghe wrote:
>         >  Hi Folks,
>         >
>         >  Im new to both technology and the mailling list.
>         >
>         >  Can you guys to explain or give any example about how can i send a
>         >  request to a servlet ?
>         >
>         >  Ur help highly appriciate
>         >
>         >  --
>         >  Chaminda Amarasinghe,
>         >
>         >
>
>
>         --
>         Orbeon Forms - Web Forms for the Enterprise Done the Right Way
>         http://www.orbeon.com/
>
>
>         --
>         You receive this message as a subscriber of the
>         [hidden email] <mailto:[hidden email]> mailing list.
>         To unsubscribe: mailto: [hidden email]
>         <mailto:[hidden email]>
>         For general help: mailto: [hidden email]
>         <mailto:[hidden email]>?subject=help
>         OW2 mailing lists service home page: http://www.ow2.org/wws
>
>
>
>
>     --
>     Chaminda Amarasinghe,
>     Software Engineer,
>     EFutures (pvt) Ltd,
>     No 46 ½, Castle Street,
>     Colombo 08
>     Sri Lanka
>     Voice
>             +94 773 538 238 (Mob)
>             +94 115 333 633 (Off)
>             +94 372 247 051 (Res)
>
>
>
>
> --
> Chaminda Amarasinghe,
> Software Engineer,
> EFutures (pvt) Ltd,
> No 46 ½, Castle Street,
> Colombo 08
> Sri Lanka
> Voice
>         +94 773 538 238 (Mob)
>         +94 115 333 633 (Off)
>         +94 372 247 051 (Res)
>


--
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: Servlet and XForms

Erik Bruchez
Administrator
In reply to this post by Chaminda
> How does it dispatch it? With a client-side redirect? With a server-

> side
> forward? What seems to matter here is: what kind of information does
> your servlet want to pass to the XForms page?
>
> This is server side forward, Servlet stores attributes in request  
> scope and these attributes are needed to populate in the XForm.
>
> something like this
>
> // Can we dispatch a xhtml like this?
> RequestDispatcher d= request.getRequestDispatcher("/view.xhtml");
>
> request.setAttribute("dep.names", "list_of_deparments")
>
> d.forward(request, response);
>
I see. The answer is that yes, you can do this with Orbeon Forms. What  
you will need is a page model, written as an XML pipeline and declared  
in a page flow. That page model will extract the request attribute and  
produce an XML document out of it using the oxf:scope-generator  
processor or the oxf:java processor.

Then the page view, which is actually the XHTML+XForms page, can  
obtain the document produced by the page model by using:

   <xforms:instance src="input:instance"/>

-Erik

--
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.com/



--
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: Servlet and XForms

Erik Bruchez
Administrator
In reply to this post by Naveen Ayyagari-2
Maybe you can test your submission just by running your XForms page in  
the XForms sandbox. This could make it a easier to figure out what's  
happening.

You an also turn on XForms logging to log all the actions taken by the  
XForms engine:

   http://www.orbeon.com/ops/doc/reference-xforms-2#xforms-debugging

-Erik

On Nov 15, 2007, at 11:52 AM, Naveen Ayyagari wrote:

> I am also having difficulties getting an application deployed as a  
> separate WAR file to function with Orbeon. I have been able to use  
> the filter-mapping to process the xform into html, but on submission  
> I am having issues. I do not seem to be able to obtain the instance  
> XML of a summited form in a servlet..  I am sure I just don't have  
> something configured correctly, but the request at the servlet is  
> empty with no instance xml.
>
> A simple sample xform that uses the separate deployment method would  
> make this much easier to figure out.
>
> Any help is greatly appreciated.
>
> Thanks
> --Naveen
>
> Chaminda Amarasinghe wrote:
>> Hi
>> Can anyone send me a working project (very simple like hello world)  
>> that has deployed as a separate war,
>> Thanks
>> Chamida
>> On 11/14/07, *Chaminda Amarasinghe* <[hidden email] <mailto:[hidden email]
>> >> wrote:
>>         Hi Erik,
>>         Many thanks for taking your time to reply,
>>         This is what I need?
>>         1) Web Client types the url (HTTP GET)in browser's address  
>> box
>>    2) The request goes to a Servlet (Say SarvletX).
>>    3) ServletX despatch the request to a XForm(Not sure its  
>> possible or
>>    not)
>>    4) That XForm consist with XForm model, Say Employee with ID and  
>> Name,
>>    5) Web Client fill the Employee ID and Name,
>>    6) Web Client post the XFrom by clicking "Submit"
>>    7) This XForm submission goes to a servlet (say ServletY),
>>    8) ServletY gets XForm Model and creates Java Object
>>         I think my explanation is clear. Sorry for my english
>>         Your kind concern in this regards highly appreciate.
>>              Thanks
>>         On 11/14/07, *Erik Bruchez* < [hidden email]
>>    <mailto:[hidden email]>> wrote:
>>        Chaminda,
>>        It depends on the type of request. If it's just an HTTP GET  
>> (i.e. a
>>        client-side redirect), you can use either xforms:load or
>>        xforms:submission. If you want to POST to a servlet, then  
>> you use
>>        xforms:submission.
>>        What does your servlet expect as input, and what does it  
>> produce
>>        as output?
>>        -Erik
>>        Chaminda Amarasinghe wrote:
>>        >  Hi Folks,
>>        >
>>        >  Im new to both technology and the mailling list.
>>        >
>>        >  Can you guys to explain or give any example about how can  
>> i send a
>>        >  request to a servlet ?
>>        >
>>        >  Ur help highly appriciate
>>        >
>>        >  --
>>        >  Chaminda Amarasinghe,
>>        >
>>        >
>>        --
>>        Orbeon Forms - Web Forms for the Enterprise Done the Right Way
>>        http://www.orbeon.com/
>>        --         You receive this message as a subscriber of the
>>        [hidden email] <mailto:[hidden email]> mailing list.
>>        To unsubscribe: mailto: [hidden email]
>>        <mailto:[hidden email]>
>>        For general help: mailto: [hidden email]
>>        <mailto:[hidden email]>?subject=help
>>        OW2 mailing lists service home page: http://www.ow2.org/wws
>>    --     Chaminda Amarasinghe,
>>    Software Engineer,
>>    EFutures (pvt) Ltd,
>>    No 46 ½, Castle Street,
>>    Colombo 08
>>    Sri Lanka
>>    Voice
>>            +94 773 538 238 (Mob)
>>            +94 115 333 633 (Off)
>>            +94 372 247 051 (Res) --
>> Chaminda Amarasinghe,
>> Software Engineer,
>> EFutures (pvt) Ltd,
>> No 46 ½, Castle Street,
>> Colombo 08
>> Sri Lanka
>> Voice
>>        +94 773 538 238 (Mob)
>>        +94 115 333 633 (Off)
>>        +94 372 247 051 (Res)
>
> --
> 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
--
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.com/



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