You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by indikamaligaspe <in...@rezgateway.com> on 2009/09/18 19:53:48 UTC

How to read an XML request from struts

Hi,

I have situation where some users will be posting an XML message (using a
java client) and some HTML forms to my application running in struts. I want
to know if there is a way that I can recognize the two different requests
from my struts acton class. 

Because once I identify the two, I can always handle the two requests
seperately with my request handlers, the problem is identifying the two
requests seperately.

Thanks
Indi
-- 
View this message in context: http://www.nabble.com/How-to-read-an-XML-request-from-struts-tp25512907p25512907.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: How to read an XML request from struts

Posted by Indika Maligaspe <in...@rezgateway.com>.

Hi All,

And thanks for all the help and advice given.
I have decided to use a request header as an attribute to inform the struts
action what type of request is coming as mentioned by Martin.

Thanks,
Indi
-----Original Message-----
From: user-return-202452-indika=rezgateway.com@struts.apache.org
[mailto:user-return-202452-indika=rezgateway.com@struts.apache.org] On
Behalf Of Indika Maligaspe
Sent: Monday, September 21, 2009 7:46 AM
To: 'Struts Users Mailing List'
Subject: RE: How to read an XML request from struts

I would also like to know what Martin has queried, if there is a way, then
it will be great.

indi


-----Original Message-----
From: user-return-202448-indika=rezgateway.com@struts.apache.org
[mailto:user-return-202448-indika=rezgateway.com@struts.apache.org] On
Behalf Of Martin Gainty
Sent: Sunday, September 20, 2009 8:33 PM
To: Struts Users Mailing List
Subject: RE: How to read an XML request from struts


Tommy/Wes
is there any way to autodetect which converter to use for jibx?
public static final String contentTypeXML = "text/xml; charset=UTF-8;
type=jibx";thanks,
Martin Gainty 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte
Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht
dient lediglich dem Austausch von Informationen und entfaltet keine
rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von
E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le
destinataire prévu, nous te demandons avec bonté que pour satisfaire
informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie
de ceci est interdite. Ce message sert à l'information seulement et n'aura
pas n'importe quel effet légalement obligatoire. Étant donné que les email
peuvent facilement être sujets à la manipulation, nous ne pouvons accepter
aucune responsabilité pour le contenu fourni.




> Date: Sun, 20 Sep 2009 10:56:57 -0400
> Subject: Re: How to read an XML request from struts
> From: wesw@wantii.com
> To: user@struts.apache.org
> 
> A good struts-y way to do it would be to create a converter that can
> convert the xml to an instance of your business object, maybe using
> xstream or jixb. Then set a field on your action of the said business
> type an configure the converter for that action.
> 
> -Wes
> 
> 
> On 9/20/09, Tommy Pham <to...@yahoo.com> wrote:
> > ----- Original Message ----
> >> From: indikamaligaspe <in...@rezgateway.com>
> >> To: user@struts.apache.org
> >> Sent: Friday, September 18, 2009 10:53:48 AM
> >> Subject: How to read an XML request from struts
> >>
> >>
> >> Hi,
> >>
> >> I have situation where some users will be posting an XML message (using
a
> >> java client) and some HTML forms to my application running in struts. I
> >> want
> >> to know if there is a way that I can recognize the two different
requests
> >> from my struts acton class.
> >>
> >> Because once I identify the two, I can always handle the two requests
> >> seperately with my request handlers, the problem is identifying the two
> >> requests seperately.
> >>
> >> Thanks
> >> Indi
> >> --
> >> View this message in context:
> >>
http://www.nabble.com/How-to-read-an-XML-request-from-struts-tp25512907p2551
2907.html
> >> Sent from the Struts - User mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> For additional commands, e-mail: user-help@struts.apache.org
> >
> > getContentType() from org.apache.struts2.dispatcher.StreamResult ?
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
> 
> 
> -- 
> Wes Wannemacher
> 
> Head Engineer, WanTii, Inc.
> Need Training? Struts, Spring, Maven, Tomcat...
> Ask me for a quote!
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 

_________________________________________________________________
Ready for Fall shows? Use Bing to find helpful ratings and reviews on
digital tv's.
http://www.bing.com/shopping/search?q=digital+tv's&form=MSHNCB&publ=WLHMTAG&
crea=TEXT_MSHNCB_Vertical_Shopping_DigitalTVs_1x1


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: How to read an XML request from struts

Posted by Indika Maligaspe <in...@rezgateway.com>.
I would also like to know what Martin has queried, if there is a way, then
it will be great.

indi


-----Original Message-----
From: user-return-202448-indika=rezgateway.com@struts.apache.org
[mailto:user-return-202448-indika=rezgateway.com@struts.apache.org] On
Behalf Of Martin Gainty
Sent: Sunday, September 20, 2009 8:33 PM
To: Struts Users Mailing List
Subject: RE: How to read an XML request from struts


Tommy/Wes
is there any way to autodetect which converter to use for jibx?
public static final String contentTypeXML = "text/xml; charset=UTF-8;
type=jibx";thanks,
Martin Gainty 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte
Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht
dient lediglich dem Austausch von Informationen und entfaltet keine
rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von
E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le
destinataire prévu, nous te demandons avec bonté que pour satisfaire
informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie
de ceci est interdite. Ce message sert à l'information seulement et n'aura
pas n'importe quel effet légalement obligatoire. Étant donné que les email
peuvent facilement être sujets à la manipulation, nous ne pouvons accepter
aucune responsabilité pour le contenu fourni.




> Date: Sun, 20 Sep 2009 10:56:57 -0400
> Subject: Re: How to read an XML request from struts
> From: wesw@wantii.com
> To: user@struts.apache.org
> 
> A good struts-y way to do it would be to create a converter that can
> convert the xml to an instance of your business object, maybe using
> xstream or jixb. Then set a field on your action of the said business
> type an configure the converter for that action.
> 
> -Wes
> 
> 
> On 9/20/09, Tommy Pham <to...@yahoo.com> wrote:
> > ----- Original Message ----
> >> From: indikamaligaspe <in...@rezgateway.com>
> >> To: user@struts.apache.org
> >> Sent: Friday, September 18, 2009 10:53:48 AM
> >> Subject: How to read an XML request from struts
> >>
> >>
> >> Hi,
> >>
> >> I have situation where some users will be posting an XML message (using
a
> >> java client) and some HTML forms to my application running in struts. I
> >> want
> >> to know if there is a way that I can recognize the two different
requests
> >> from my struts acton class.
> >>
> >> Because once I identify the two, I can always handle the two requests
> >> seperately with my request handlers, the problem is identifying the two
> >> requests seperately.
> >>
> >> Thanks
> >> Indi
> >> --
> >> View this message in context:
> >>
http://www.nabble.com/How-to-read-an-XML-request-from-struts-tp25512907p2551
2907.html
> >> Sent from the Struts - User mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> For additional commands, e-mail: user-help@struts.apache.org
> >
> > getContentType() from org.apache.struts2.dispatcher.StreamResult ?
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
> 
> 
> -- 
> Wes Wannemacher
> 
> Head Engineer, WanTii, Inc.
> Need Training? Struts, Spring, Maven, Tomcat...
> Ask me for a quote!
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 

_________________________________________________________________
Ready for Fall shows? Use Bing to find helpful ratings and reviews on
digital tv's.
http://www.bing.com/shopping/search?q=digital+tv's&form=MSHNCB&publ=WLHMTAG&
crea=TEXT_MSHNCB_Vertical_Shopping_DigitalTVs_1x1


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: How to read an XML request from struts

Posted by Martin Gainty <mg...@hotmail.com>.
Tommy/Wes
is there any way to autodetect which converter to use for jibx?
public static final String contentTypeXML = "text/xml; charset=UTF-8; type=jibx";thanks,
Martin Gainty 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.




> Date: Sun, 20 Sep 2009 10:56:57 -0400
> Subject: Re: How to read an XML request from struts
> From: wesw@wantii.com
> To: user@struts.apache.org
> 
> A good struts-y way to do it would be to create a converter that can
> convert the xml to an instance of your business object, maybe using
> xstream or jixb. Then set a field on your action of the said business
> type an configure the converter for that action.
> 
> -Wes
> 
> 
> On 9/20/09, Tommy Pham <to...@yahoo.com> wrote:
> > ----- Original Message ----
> >> From: indikamaligaspe <in...@rezgateway.com>
> >> To: user@struts.apache.org
> >> Sent: Friday, September 18, 2009 10:53:48 AM
> >> Subject: How to read an XML request from struts
> >>
> >>
> >> Hi,
> >>
> >> I have situation where some users will be posting an XML message (using a
> >> java client) and some HTML forms to my application running in struts. I
> >> want
> >> to know if there is a way that I can recognize the two different requests
> >> from my struts acton class.
> >>
> >> Because once I identify the two, I can always handle the two requests
> >> seperately with my request handlers, the problem is identifying the two
> >> requests seperately.
> >>
> >> Thanks
> >> Indi
> >> --
> >> View this message in context:
> >> http://www.nabble.com/How-to-read-an-XML-request-from-struts-tp25512907p25512907.html
> >> Sent from the Struts - User mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> For additional commands, e-mail: user-help@struts.apache.org
> >
> > getContentType() from org.apache.struts2.dispatcher.StreamResult ?
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
> 
> 
> -- 
> Wes Wannemacher
> 
> Head Engineer, WanTii, Inc.
> Need Training? Struts, Spring, Maven, Tomcat...
> Ask me for a quote!
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 

_________________________________________________________________
Ready for Fall shows? Use Bing to find helpful ratings and reviews on digital tv's.
http://www.bing.com/shopping/search?q=digital+tv's&form=MSHNCB&publ=WLHMTAG&crea=TEXT_MSHNCB_Vertical_Shopping_DigitalTVs_1x1

Re: How to read an XML request from struts

Posted by Wes Wannemacher <we...@wantii.com>.
A good struts-y way to do it would be to create a converter that can
convert the xml to an instance of your business object, maybe using
xstream or jixb. Then set a field on your action of the said business
type an configure the converter for that action.

-Wes


On 9/20/09, Tommy Pham <to...@yahoo.com> wrote:
> ----- Original Message ----
>> From: indikamaligaspe <in...@rezgateway.com>
>> To: user@struts.apache.org
>> Sent: Friday, September 18, 2009 10:53:48 AM
>> Subject: How to read an XML request from struts
>>
>>
>> Hi,
>>
>> I have situation where some users will be posting an XML message (using a
>> java client) and some HTML forms to my application running in struts. I
>> want
>> to know if there is a way that I can recognize the two different requests
>> from my struts acton class.
>>
>> Because once I identify the two, I can always handle the two requests
>> seperately with my request handlers, the problem is identifying the two
>> requests seperately.
>>
>> Thanks
>> Indi
>> --
>> View this message in context:
>> http://www.nabble.com/How-to-read-an-XML-request-from-struts-tp25512907p25512907.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>
> getContentType() from org.apache.struts2.dispatcher.StreamResult ?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
Wes Wannemacher

Head Engineer, WanTii, Inc.
Need Training? Struts, Spring, Maven, Tomcat...
Ask me for a quote!

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: How to read an XML request from struts

Posted by Tommy Pham <to...@yahoo.com>.
----- Original Message ----
> From: indikamaligaspe <in...@rezgateway.com>
> To: user@struts.apache.org
> Sent: Friday, September 18, 2009 10:53:48 AM
> Subject: How to read an XML request from struts
> 
> 
> Hi,
> 
> I have situation where some users will be posting an XML message (using a
> java client) and some HTML forms to my application running in struts. I want
> to know if there is a way that I can recognize the two different requests
> from my struts acton class. 
> 
> Because once I identify the two, I can always handle the two requests
> seperately with my request handlers, the problem is identifying the two
> requests seperately.
> 
> Thanks
> Indi
> -- 
> View this message in context: 
> http://www.nabble.com/How-to-read-an-XML-request-from-struts-tp25512907p25512907.html
> Sent from the Struts - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org

getContentType() from org.apache.struts2.dispatcher.StreamResult ?

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org