You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Musachy Barroso <mu...@gmail.com> on 2009/05/08 20:13:02 UTC

Re: Problems setting attributes on my Action using Restful2ActionMapper

That part has always lacked good documentation. I have never used
myself so I have no idea how it works. You can submit a CLA and get
edit right to the wiki.

musachy

On Fri, May 8, 2009 at 1:00 PM, David Rocks <ro...@hotmail.com> wrote:
>
> Hi,
>
>
>
> managed to get this kind of working although I am constrained to callin in my action the the names of the methods hard coded in the Restful2ActionMapper class.
>
>
>
> Firstly I have to set...
>
>
>
> struts.mapper.alwaysSelectFullNamespace=false
> struts.mapper.idParameterName=entityName  <-- the name of the parameter to be set in the action class
>
>
>
> Also the documentation is wrong, it is not
>
>
>
>  http://HOST/ACTION_NAME/PARAM_NAME1/PARAM_VALUE1/PARAM_NAME2/PARAM_VALUE2
>
>
>
> but
>
>
>
>  http://HOST/PARAM_NAME2/PARAM_VALUE2/ACTION_NAME/PARAM_VALUE1
>
>
>
> In the ACTION_NAME part I cannot set the action and the method name, i just have to set the action name and it picks up the view method.
>
>
>
> so it has to be
>
>
>
> http://127.0.0.1:8080/myApp/region/England -> that goes to view and puts the value of england into entityName  as shown above
>
>
>
> I cannot force it to go to a get method like
>
>
>
> http://127.0.0.1:8080/myApp/region/get/England   -> which calls get and sets entityName
>
>
>
> I would be quite happy to set @action( "region/get" ) on my action method.
>
>
>
> So the docs could be updated and if someone knows how to set the method and action name in a rest URL using Restful2ActionMapper  then I am all ears.
>
>
>
> Thanks
>
>
>
> David
>
>
>
>
>> From: rocks_david@hotmail.com
>> To: user@struts.apache.org
>> Subject: Problems setting attributes on my Action using Restful2ActionMapper
>> Date: Thu, 7 May 2009 15:40:30 +0000
>>
>>
>> Hi,
>>
>>
>> I am trying to work out how populate attributes on using Restful2ActionMapper but I think I am missing something in my configuration and wondered if someone could give me some advice.
>>
>>
>> My struts file is
>>
>>
>> <struts>
>> <constant name="struts.mapper.class" value="restful2" />
>> <constant name="struts.convention.result.path" value="/WEB-INF/jsp" />
>> <constant name="struts.enable.SlashesInActionNames" value="true" />
>> <constant name="struts.convention.package.locators" value="action" />
>>
>>
>> <package name="default" extends="struts-default">
>>
>>
>> <action name="region/*" class="com.action.RegionAction" >
>> <param name="name">{0}</param>
>> </action>
>> </struts>
>>
>>
>> My action
>>
>> package com.action ;
>>
>> @Results({
>> @Result(name="get", location="region/displayRegion.jsp")
>> })
>> public class RegionAction extends ActionSupport {
>>
>>
>> private String name ;
>> private int id ;
>>
>>
>> public String get(){
>> …..
>> return "get" ;
>> }
>>
>>
>> // name & id getters and setters …...
>> }
>>
>>
>> I am trying to get the URL into the state like as the documentation claims it can handle
>>
>>
>> http://HOST/ACTION_NAME/PARAM_NAME1/PARAM_VALUE1/PARAM_NAME2/PARAM_VALUE2
>>
>>
>> So My URL would be like...
>>
>>
>> http://127.0.0.1:8080/region/name/Mexico/id/2
>>
>>
>> But that is not working out. Is there something I have missed?
>>
>>
>> Many thanks
>>
>>
>> _________________________________________________________________
>> Hotmail® has a new way to see what's up with your friends.
>> http://windowslive.com/Tutorial/Hotmail/WhatsNew?ocid=TXT_TAGLM_WL_HM_Tutorial_WhatsNew1_052009
>
> _________________________________________________________________
> Hotmail® has a new way to see what's up with your friends.
> http://windowslive.com/Tutorial/Hotmail/WhatsNew?ocid=TXT_TAGLM_WL_HM_Tutorial_WhatsNew1_052009



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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


RE: Problems setting attributes on my Action using Restful2ActionMapper

Posted by Martin Gainty <mg...@hotmail.com>.
a guy named 'david' said he wanted to update the wiki..i thought it was u?

Martin 
______________________________________________ 
Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
This message is confidential. If you should not be the intended receiver, then we ask politely to report. Each unauthorized forwarding or manufacturing of a copy is inadmissible. This message serves only for the exchange of information and has no legal binding effect. Due to the easy manipulation of emails we cannot take responsibility over the the contents.
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: Fri, 8 May 2009 18:53:04 -0400
> From: newton.dave@yahoo.com
> To: user@struts.apache.org
> Subject: Re: Problems setting attributes on my Action using 	Restful2ActionMapper
> 
> Musachy Barroso wrote:
> > On Fri, May 8, 2009 at 5:52 PM, David Rocks <ro...@hotmail.com> wrote:
> >> Anyway it's 11pm. Pizza and beer time.
> > 
> > now that, sounds good :)
> > 
> > musachy
> 
> I'm so confused: I saw responses but never saw the messages they were in 
> response to.
> 
> Dave
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 

_________________________________________________________________
Hotmail® has ever-growing storage! Don’t worry about storage limits.
http://windowslive.com/Tutorial/Hotmail/Storage?ocid=TXT_TAGLM_WL_HM_Tutorial_Storage1_052009

Re: Problems setting attributes on my Action using Restful2ActionMapper

Posted by Dave Newton <ne...@yahoo.com>.
Musachy Barroso wrote:
> On Fri, May 8, 2009 at 5:52 PM, David Rocks <ro...@hotmail.com> wrote:
>> Anyway it's 11pm. Pizza and beer time.
> 
> now that, sounds good :)
> 
> musachy

I'm so confused: I saw responses but never saw the messages they were in 
response to.

Dave


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


Re: Problems setting attributes on my Action using Restful2ActionMapper

Posted by Musachy Barroso <mu...@gmail.com>.
On Fri, May 8, 2009 at 5:52 PM, David Rocks <ro...@hotmail.com> wrote:
> Anyway it's 11pm. Pizza and beer time.

now that, sounds good :)

musachy
-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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


RE: Problems setting attributes on my Action using Restful2ActionMapper

Posted by David Rocks <ro...@hotmail.com>.
Cool, I will get that done on Monday, post a note to the dev list and get something working to document shortly after.

 

Still messing about with the code, not 100% on all angles but getting there.

 

Anyway it's 11pm. Pizza and beer time.

 

David

 

 

 


 
> Date: Fri, 8 May 2009 16:56:48 -0400
> Subject: Re: Problems setting attributes on my Action using Restful2ActionMapper
> From: wesw@wantii.com
> To: user@struts.apache.org
> 
> You need to apply, you just need to sign it. It is an apache thing. It
> lets the foundation know you aren't going to claim copyright on code
> or documentation you create for us. Search for cla or icla on the main
> apache page. Once you fill it out and send it in make sure you post a
> message to dev@struts.apache.org because we won't know to grant you
> karma in the wiki otherwise.
> 
> -Wes
> 
> On 5/8/09, David Rocks <ro...@hotmail.com> wrote:
> >
> > The documentation was pretty misleading, I wasted a few hours just chasing
> > stuff on the web, in the end it came down to just stepping through the code.
> >
> >
> >
> > I tried to get the convention plugin working first but could not work out
> > how to get that to work with my application although I never looked at the
> > code for that.
> >
> >
> >
> > I am surprised that the REST stuff is quite low key with struts2, or that is
> > the way it seems to me, it really is a make or break for my application/site
> > as the URLs will need to get favourably viewed by google for it to work out.
> >
> >
> >
> > I am quite happy to knock up a small test app and write a doc on this for
> > the WIKI. Can I just apply for a 'CLA'?
> >
> >
> >
> > David
> >
> >
> >
> >
> >
> >> Date: Fri, 8 May 2009 14:13:02 -0400
> >> Subject: Re: Problems setting attributes on my Action using
> >> Restful2ActionMapper
> >> From: musachy@gmail.com
> >> To: user@struts.apache.org
> >>
> >> That part has always lacked good documentation. I have never used
> >> myself so I have no idea how it works. You can submit a CLA and get
> >> edit right to the wiki.
> >>
> >> musachy
> >>
> >> On Fri, May 8, 2009 at 1:00 PM, David Rocks <ro...@hotmail.com>
> >> wrote:
> >> >
> >> > Hi,
> >> >
> >> >
> >> >
> >> > managed to get this kind of working although I am constrained to callin
> >> > in my action the the names of the methods hard coded in the
> >> > Restful2ActionMapper class.
> >> >
> >> >
> >> >
> >> > Firstly I have to set...
> >> >
> >> >
> >> >
> >> > struts.mapper.alwaysSelectFullNamespace=false
> >> > struts.mapper.idParameterName=entityName <-- the name of the parameter
> >> > to be set in the action class
> >> >
> >> >
> >> >
> >> > Also the documentation is wrong, it is not
> >> >
> >> >
> >> >
> >> >
> >> > http://HOST/ACTION_NAME/PARAM_NAME1/PARAM_VALUE1/PARAM_NAME2/PARAM_VALUE2
> >> >
> >> >
> >> >
> >> > but
> >> >
> >> >
> >> >
> >> > http://HOST/PARAM_NAME2/PARAM_VALUE2/ACTION_NAME/PARAM_VALUE1
> >> >
> >> >
> >> >
> >> > In the ACTION_NAME part I cannot set the action and the method name, i
> >> > just have to set the action name and it picks up the view method.
> >> >
> >> >
> >> >
> >> > so it has to be
> >> >
> >> >
> >> >
> >> > http://127.0.0.1:8080/myApp/region/England -> that goes to view and puts
> >> > the value of england into entityName as shown above
> >> >
> >> >
> >> >
> >> > I cannot force it to go to a get method like
> >> >
> >> >
> >> >
> >> > http://127.0.0.1:8080/myApp/region/get/England -> which calls get and
> >> > sets entityName
> >> >
> >> >
> >> >
> >> > I would be quite happy to set @action( "region/get" ) on my action
> >> > method.
> >> >
> >> >
> >> >
> >> > So the docs could be updated and if someone knows how to set the method
> >> > and action name in a rest URL using Restful2ActionMapper then I am all
> >> > ears.
> >> >
> >> >
> >> >
> >> > Thanks
> >> >
> >> >
> >> >
> >> > David
> >> >
> >> >
> >> >
> >> >
> >> >> From: rocks_david@hotmail.com
> >> >> To: user@struts.apache.org
> >> >> Subject: Problems setting attributes on my Action using
> >> >> Restful2ActionMapper
> >> >> Date: Thu, 7 May 2009 15:40:30 +0000
> >> >>
> >> >>
> >> >> Hi,
> >> >>
> >> >>
> >> >> I am trying to work out how populate attributes on using
> >> >> Restful2ActionMapper but I think I am missing something in my
> >> >> configuration and wondered if someone could give me some advice.
> >> >>
> >> >>
> >> >> My struts file is
> >> >>
> >> >>
> >> >> <struts>
> >> >> <constant name="struts.mapper.class" value="restful2" />
> >> >> <constant name="struts.convention.result.path" value="/WEB-INF/jsp" />
> >> >> <constant name="struts.enable.SlashesInActionNames" value="true" />
> >> >> <constant name="struts.convention.package.locators" value="action" />
> >> >>
> >> >>
> >> >> <package name="default" extends="struts-default">
> >> >>
> >> >>
> >> >> <action name="region/*" class="com.action.RegionAction" >
> >> >> <param name="name">{0}</param>
> >> >> </action>
> >> >> </struts>
> >> >>
> >> >>
> >> >> My action
> >> >>
> >> >> package com.action ;
> >> >>
> >> >> @Results({
> >> >> @Result(name="get", location="region/displayRegion.jsp")
> >> >> })
> >> >> public class RegionAction extends ActionSupport {
> >> >>
> >> >>
> >> >> private String name ;
> >> >> private int id ;
> >> >>
> >> >>
> >> >> public String get(){
> >> >> …..
> >> >> return "get" ;
> >> >> }
> >> >>
> >> >>
> >> >> // name & id getters and setters …...
> >> >> }
> >> >>
> >> >>
> >> >> I am trying to get the URL into the state like as the documentation
> >> >> claims it can handle
> >> >>
> >> >>
> >> >> http://HOST/ACTION_NAME/PARAM_NAME1/PARAM_VALUE1/PARAM_NAME2/PARAM_VALUE2
> >> >>
> >> >>
> >> >> So My URL would be like...
> >> >>
> >> >>
> >> >> http://127.0.0.1:8080/region/name/Mexico/id/2
> >> >>
> >> >>
> >> >> But that is not working out. Is there something I have missed?
> >> >>
> >> >>
> >> >> Many thanks
> >> >>
> >> >>
> >> >> _________________________________________________________________
> >> >> Hotmail® has a new way to see what's up with your friends.
> >> >> http://windowslive.com/Tutorial/Hotmail/WhatsNew?ocid=TXT_TAGLM_WL_HM_Tutorial_WhatsNew1_052009
> >> >
> >> > _________________________________________________________________
> >> > Hotmail® has a new way to see what's up with your friends.
> >> > http://windowslive.com/Tutorial/Hotmail/WhatsNew?ocid=TXT_TAGLM_WL_HM_Tutorial_WhatsNew1_052009
> >>
> >>
> >>
> >> --
> >> "Hey you! Would you help me to carry the stone?" Pink Floyd
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> For additional commands, e-mail: user-help@struts.apache.org
> >>
> >
> > _________________________________________________________________
> > Hotmail® has a new way to see what's up with your friends.
> > http://windowslive.com/Tutorial/Hotmail/WhatsNew?ocid=TXT_TAGLM_WL_HM_Tutorial_WhatsNew1_052009
> 
> 
> -- 
> Wes Wannemacher
> Author - Struts 2 In Practice
> Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
> http://www.manning.com/wannemacher
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 

_________________________________________________________________
Hotmail® goes with you. 
http://windowslive.com/Tutorial/Hotmail/Mobile?ocid=TXT_TAGLM_WL_HM_Tutorial_Mobile1_052009

Re: Problems setting attributes on my Action using Restful2ActionMapper

Posted by Wes Wannemacher <we...@wantii.com>.
You need to apply, you just need to sign it. It is an apache thing. It
lets the foundation know you aren't going to claim copyright on code
or documentation you create for us. Search for cla or icla on the main
apache page. Once you fill it out and send it in make sure you post a
message to dev@struts.apache.org because we won't know to grant you
karma in the wiki otherwise.

-Wes

On 5/8/09, David Rocks <ro...@hotmail.com> wrote:
>
> The documentation was pretty misleading, I wasted a few hours just chasing
> stuff on the web, in the end it came down to just stepping through the code.
>
>
>
> I tried to get the convention plugin working first but could not work out
> how to get that to work with my application although I never looked at the
> code for that.
>
>
>
> I am surprised that the REST stuff is quite low key with struts2, or that is
> the way it seems to me, it really is a make or break for my application/site
> as the URLs will need to get favourably viewed by google for it to work out.
>
>
>
> I am quite happy to knock up a small test app and write a doc on this for
> the WIKI. Can I just apply for a 'CLA'?
>
>
>
> David
>
>
>
>
>
>> Date: Fri, 8 May 2009 14:13:02 -0400
>> Subject: Re: Problems setting attributes on my Action using
>> Restful2ActionMapper
>> From: musachy@gmail.com
>> To: user@struts.apache.org
>>
>> That part has always lacked good documentation. I have never used
>> myself so I have no idea how it works. You can submit a CLA and get
>> edit right to the wiki.
>>
>> musachy
>>
>> On Fri, May 8, 2009 at 1:00 PM, David Rocks <ro...@hotmail.com>
>> wrote:
>> >
>> > Hi,
>> >
>> >
>> >
>> > managed to get this kind of working although I am constrained to callin
>> > in my action the the names of the methods hard coded in the
>> > Restful2ActionMapper class.
>> >
>> >
>> >
>> > Firstly I have to set...
>> >
>> >
>> >
>> > struts.mapper.alwaysSelectFullNamespace=false
>> > struts.mapper.idParameterName=entityName  <-- the name of the parameter
>> > to be set in the action class
>> >
>> >
>> >
>> > Also the documentation is wrong, it is not
>> >
>> >
>> >
>> >
>> > http://HOST/ACTION_NAME/PARAM_NAME1/PARAM_VALUE1/PARAM_NAME2/PARAM_VALUE2
>> >
>> >
>> >
>> > but
>> >
>> >
>> >
>> >  http://HOST/PARAM_NAME2/PARAM_VALUE2/ACTION_NAME/PARAM_VALUE1
>> >
>> >
>> >
>> > In the ACTION_NAME part I cannot set the action and the method name, i
>> > just have to set the action name and it picks up the view method.
>> >
>> >
>> >
>> > so it has to be
>> >
>> >
>> >
>> > http://127.0.0.1:8080/myApp/region/England -> that goes to view and puts
>> > the value of england into entityName  as shown above
>> >
>> >
>> >
>> > I cannot force it to go to a get method like
>> >
>> >
>> >
>> > http://127.0.0.1:8080/myApp/region/get/England   -> which calls get and
>> > sets entityName
>> >
>> >
>> >
>> > I would be quite happy to set @action( "region/get" ) on my action
>> > method.
>> >
>> >
>> >
>> > So the docs could be updated and if someone knows how to set the method
>> > and action name in a rest URL using Restful2ActionMapper  then I am all
>> > ears.
>> >
>> >
>> >
>> > Thanks
>> >
>> >
>> >
>> > David
>> >
>> >
>> >
>> >
>> >> From: rocks_david@hotmail.com
>> >> To: user@struts.apache.org
>> >> Subject: Problems setting attributes on my Action using
>> >> Restful2ActionMapper
>> >> Date: Thu, 7 May 2009 15:40:30 +0000
>> >>
>> >>
>> >> Hi,
>> >>
>> >>
>> >> I am trying to work out how populate attributes on using
>> >> Restful2ActionMapper but I think I am missing something in my
>> >> configuration and wondered if someone could give me some advice.
>> >>
>> >>
>> >> My struts file is
>> >>
>> >>
>> >> <struts>
>> >> <constant name="struts.mapper.class" value="restful2" />
>> >> <constant name="struts.convention.result.path" value="/WEB-INF/jsp" />
>> >> <constant name="struts.enable.SlashesInActionNames" value="true" />
>> >> <constant name="struts.convention.package.locators" value="action" />
>> >>
>> >>
>> >> <package name="default" extends="struts-default">
>> >>
>> >>
>> >> <action name="region/*" class="com.action.RegionAction" >
>> >> <param name="name">{0}</param>
>> >> </action>
>> >> </struts>
>> >>
>> >>
>> >> My action
>> >>
>> >> package com.action ;
>> >>
>> >> @Results({
>> >> @Result(name="get", location="region/displayRegion.jsp")
>> >> })
>> >> public class RegionAction extends ActionSupport {
>> >>
>> >>
>> >> private String name ;
>> >> private int id ;
>> >>
>> >>
>> >> public String get(){
>> >> …..
>> >> return "get" ;
>> >> }
>> >>
>> >>
>> >> // name & id getters and setters …...
>> >> }
>> >>
>> >>
>> >> I am trying to get the URL into the state like as the documentation
>> >> claims it can handle
>> >>
>> >>
>> >> http://HOST/ACTION_NAME/PARAM_NAME1/PARAM_VALUE1/PARAM_NAME2/PARAM_VALUE2
>> >>
>> >>
>> >> So My URL would be like...
>> >>
>> >>
>> >> http://127.0.0.1:8080/region/name/Mexico/id/2
>> >>
>> >>
>> >> But that is not working out. Is there something I have missed?
>> >>
>> >>
>> >> Many thanks
>> >>
>> >>
>> >> _________________________________________________________________
>> >> Hotmail® has a new way to see what's up with your friends.
>> >> http://windowslive.com/Tutorial/Hotmail/WhatsNew?ocid=TXT_TAGLM_WL_HM_Tutorial_WhatsNew1_052009
>> >
>> > _________________________________________________________________
>> > Hotmail® has a new way to see what's up with your friends.
>> > http://windowslive.com/Tutorial/Hotmail/WhatsNew?ocid=TXT_TAGLM_WL_HM_Tutorial_WhatsNew1_052009
>>
>>
>>
>> --
>> "Hey you! Would you help me to carry the stone?" Pink Floyd
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>
> _________________________________________________________________
> Hotmail® has a new way to see what's up with your friends.
> http://windowslive.com/Tutorial/Hotmail/WhatsNew?ocid=TXT_TAGLM_WL_HM_Tutorial_WhatsNew1_052009


-- 
Wes Wannemacher
Author - Struts 2 In Practice
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
http://www.manning.com/wannemacher

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


RE: Problems setting attributes on my Action using Restful2ActionMapper

Posted by Martin Gainty <mg...@hotmail.com>.
we already have a david..mind if we use your middle name?

thx,
Martin Gainty 
______________________________________________ 
Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
This message is confidential. If you should not be the intended receiver, then we ask politely to report. Each unauthorized forwarding or manufacturing of a copy is inadmissible. This message serves only for the exchange of information and has no legal binding effect. Due to the easy manipulation of emails we cannot take responsibility over the the contents.
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: Fri, 8 May 2009 16:56:42 -0400
> Subject: Re: Problems setting attributes on my Action using 	Restful2ActionMapper
> From: musachy@gmail.com
> To: user@struts.apache.org
> 
> Take a look here:
> http://struts.apache.org/2.x/docs/editing-the-documentation.html, the
> CLA is a form that you need to fax, after that, drop an email in the
> dev@ user list asking for rights to edit the wiki.
> 
> musachy
> 
> On Fri, May 8, 2009 at 3:43 PM, David Rocks <ro...@hotmail.com> wrote:
> >
> > The documentation was pretty misleading, I wasted a few hours just chasing stuff on the web, in the end it came down to just stepping through the code.
> >
> >
> >
> > I tried to get the convention plugin working first but could not work out how to get that to work with my application although I never looked at the code for that.
> >
> >
> >
> > I am surprised that the REST stuff is quite low key with struts2, or that is the way it seems to me, it really is a make or break for my application/site as the URLs will need to get favourably viewed by google for it to work out.
> >
> >
> >
> > I am quite happy to knock up a small test app and write a doc on this for the WIKI. Can I just apply for a 'CLA'?
> >
> >
> >
> > David
> >
> >
> >
> >
> >
> >> Date: Fri, 8 May 2009 14:13:02 -0400
> >> Subject: Re: Problems setting attributes on my Action using Restful2ActionMapper
> >> From: musachy@gmail.com
> >> To: user@struts.apache.org
> >>
> >> That part has always lacked good documentation. I have never used
> >> myself so I have no idea how it works. You can submit a CLA and get
> >> edit right to the wiki.
> >>
> >> musachy
> >>
> >> On Fri, May 8, 2009 at 1:00 PM, David Rocks <ro...@hotmail.com> wrote:
> >> >
> >> > Hi,
> >> >
> >> >
> >> >
> >> > managed to get this kind of working although I am constrained to callin in my action the the names of the methods hard coded in the Restful2ActionMapper class.
> >> >
> >> >
> >> >
> >> > Firstly I have to set...
> >> >
> >> >
> >> >
> >> > struts.mapper.alwaysSelectFullNamespace=false
> >> > struts.mapper.idParameterName=entityName  <-- the name of the parameter to be set in the action class
> >> >
> >> >
> >> >
> >> > Also the documentation is wrong, it is not
> >> >
> >> >
> >> >
> >> >  http://HOST/ACTION_NAME/PARAM_NAME1/PARAM_VALUE1/PARAM_NAME2/PARAM_VALUE2
> >> >
> >> >
> >> >
> >> > but
> >> >
> >> >
> >> >
> >> >  http://HOST/PARAM_NAME2/PARAM_VALUE2/ACTION_NAME/PARAM_VALUE1
> >> >
> >> >
> >> >
> >> > In the ACTION_NAME part I cannot set the action and the method name, i just have to set the action name and it picks up the view method.
> >> >
> >> >
> >> >
> >> > so it has to be
> >> >
> >> >
> >> >
> >> > http://127.0.0.1:8080/myApp/region/England -> that goes to view and puts the value of england into entityName  as shown above
> >> >
> >> >
> >> >
> >> > I cannot force it to go to a get method like
> >> >
> >> >
> >> >
> >> > http://127.0.0.1:8080/myApp/region/get/England   -> which calls get and sets entityName
> >> >
> >> >
> >> >
> >> > I would be quite happy to set @action( "region/get" ) on my action method.
> >> >
> >> >
> >> >
> >> > So the docs could be updated and if someone knows how to set the method and action name in a rest URL using Restful2ActionMapper  then I am all ears.
> >> >
> >> >
> >> >
> >> > Thanks
> >> >
> >> >
> >> >
> >> > David
> >> >
> >> >
> >> >
> >> >
> >> >> From: rocks_david@hotmail.com
> >> >> To: user@struts.apache.org
> >> >> Subject: Problems setting attributes on my Action using Restful2ActionMapper
> >> >> Date: Thu, 7 May 2009 15:40:30 +0000
> >> >>
> >> >>
> >> >> Hi,
> >> >>
> >> >>
> >> >> I am trying to work out how populate attributes on using Restful2ActionMapper but I think I am missing something in my configuration and wondered if someone could give me some advice.
> >> >>
> >> >>
> >> >> My struts file is
> >> >>
> >> >>
> >> >> <struts>
> >> >> <constant name="struts.mapper.class" value="restful2" />
> >> >> <constant name="struts.convention.result.path" value="/WEB-INF/jsp" />
> >> >> <constant name="struts.enable.SlashesInActionNames" value="true" />
> >> >> <constant name="struts.convention.package.locators" value="action" />
> >> >>
> >> >>
> >> >> <package name="default" extends="struts-default">
> >> >>
> >> >>
> >> >> <action name="region/*" class="com.action.RegionAction" >
> >> >> <param name="name">{0}</param>
> >> >> </action>
> >> >> </struts>
> >> >>
> >> >>
> >> >> My action
> >> >>
> >> >> package com.action ;
> >> >>
> >> >> @Results({
> >> >> @Result(name="get", location="region/displayRegion.jsp")
> >> >> })
> >> >> public class RegionAction extends ActionSupport {
> >> >>
> >> >>
> >> >> private String name ;
> >> >> private int id ;
> >> >>
> >> >>
> >> >> public String get(){
> >> >> …..
> >> >> return "get" ;
> >> >> }
> >> >>
> >> >>
> >> >> // name & id getters and setters …...
> >> >> }
> >> >>
> >> >>
> >> >> I am trying to get the URL into the state like as the documentation claims it can handle
> >> >>
> >> >>
> >> >> http://HOST/ACTION_NAME/PARAM_NAME1/PARAM_VALUE1/PARAM_NAME2/PARAM_VALUE2
> >> >>
> >> >>
> >> >> So My URL would be like...
> >> >>
> >> >>
> >> >> http://127.0.0.1:8080/region/name/Mexico/id/2
> >> >>
> >> >>
> >> >> But that is not working out. Is there something I have missed?
> >> >>
> >> >>
> >> >> Many thanks
> >> >>
> >> >>
> >> >> _________________________________________________________________
> >> >> Hotmail® has a new way to see what's up with your friends.
> >> >> http://windowslive.com/Tutorial/Hotmail/WhatsNew?ocid=TXT_TAGLM_WL_HM_Tutorial_WhatsNew1_052009
> >> >
> >> > _________________________________________________________________
> >> > Hotmail® has a new way to see what's up with your friends.
> >> > http://windowslive.com/Tutorial/Hotmail/WhatsNew?ocid=TXT_TAGLM_WL_HM_Tutorial_WhatsNew1_052009
> >>
> >>
> >>
> >> --
> >> "Hey you! Would you help me to carry the stone?" Pink Floyd
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> For additional commands, e-mail: user-help@struts.apache.org
> >>
> >
> > _________________________________________________________________
> > Hotmail® has a new way to see what's up with your friends.
> > http://windowslive.com/Tutorial/Hotmail/WhatsNew?ocid=TXT_TAGLM_WL_HM_Tutorial_WhatsNew1_052009
> 
> 
> 
> -- 
> "Hey you! Would you help me to carry the stone?" Pink Floyd
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 

_________________________________________________________________
Hotmail® has ever-growing storage! Don’t worry about storage limits.
http://windowslive.com/Tutorial/Hotmail/Storage?ocid=TXT_TAGLM_WL_HM_Tutorial_Storage1_052009

Re: Problems setting attributes on my Action using Restful2ActionMapper

Posted by Musachy Barroso <mu...@gmail.com>.
Take a look here:
http://struts.apache.org/2.x/docs/editing-the-documentation.html, the
CLA is a form that you need to fax, after that, drop an email in the
dev@ user list asking for rights to edit the wiki.

musachy

On Fri, May 8, 2009 at 3:43 PM, David Rocks <ro...@hotmail.com> wrote:
>
> The documentation was pretty misleading, I wasted a few hours just chasing stuff on the web, in the end it came down to just stepping through the code.
>
>
>
> I tried to get the convention plugin working first but could not work out how to get that to work with my application although I never looked at the code for that.
>
>
>
> I am surprised that the REST stuff is quite low key with struts2, or that is the way it seems to me, it really is a make or break for my application/site as the URLs will need to get favourably viewed by google for it to work out.
>
>
>
> I am quite happy to knock up a small test app and write a doc on this for the WIKI. Can I just apply for a 'CLA'?
>
>
>
> David
>
>
>
>
>
>> Date: Fri, 8 May 2009 14:13:02 -0400
>> Subject: Re: Problems setting attributes on my Action using Restful2ActionMapper
>> From: musachy@gmail.com
>> To: user@struts.apache.org
>>
>> That part has always lacked good documentation. I have never used
>> myself so I have no idea how it works. You can submit a CLA and get
>> edit right to the wiki.
>>
>> musachy
>>
>> On Fri, May 8, 2009 at 1:00 PM, David Rocks <ro...@hotmail.com> wrote:
>> >
>> > Hi,
>> >
>> >
>> >
>> > managed to get this kind of working although I am constrained to callin in my action the the names of the methods hard coded in the Restful2ActionMapper class.
>> >
>> >
>> >
>> > Firstly I have to set...
>> >
>> >
>> >
>> > struts.mapper.alwaysSelectFullNamespace=false
>> > struts.mapper.idParameterName=entityName  <-- the name of the parameter to be set in the action class
>> >
>> >
>> >
>> > Also the documentation is wrong, it is not
>> >
>> >
>> >
>> >  http://HOST/ACTION_NAME/PARAM_NAME1/PARAM_VALUE1/PARAM_NAME2/PARAM_VALUE2
>> >
>> >
>> >
>> > but
>> >
>> >
>> >
>> >  http://HOST/PARAM_NAME2/PARAM_VALUE2/ACTION_NAME/PARAM_VALUE1
>> >
>> >
>> >
>> > In the ACTION_NAME part I cannot set the action and the method name, i just have to set the action name and it picks up the view method.
>> >
>> >
>> >
>> > so it has to be
>> >
>> >
>> >
>> > http://127.0.0.1:8080/myApp/region/England -> that goes to view and puts the value of england into entityName  as shown above
>> >
>> >
>> >
>> > I cannot force it to go to a get method like
>> >
>> >
>> >
>> > http://127.0.0.1:8080/myApp/region/get/England   -> which calls get and sets entityName
>> >
>> >
>> >
>> > I would be quite happy to set @action( "region/get" ) on my action method.
>> >
>> >
>> >
>> > So the docs could be updated and if someone knows how to set the method and action name in a rest URL using Restful2ActionMapper  then I am all ears.
>> >
>> >
>> >
>> > Thanks
>> >
>> >
>> >
>> > David
>> >
>> >
>> >
>> >
>> >> From: rocks_david@hotmail.com
>> >> To: user@struts.apache.org
>> >> Subject: Problems setting attributes on my Action using Restful2ActionMapper
>> >> Date: Thu, 7 May 2009 15:40:30 +0000
>> >>
>> >>
>> >> Hi,
>> >>
>> >>
>> >> I am trying to work out how populate attributes on using Restful2ActionMapper but I think I am missing something in my configuration and wondered if someone could give me some advice.
>> >>
>> >>
>> >> My struts file is
>> >>
>> >>
>> >> <struts>
>> >> <constant name="struts.mapper.class" value="restful2" />
>> >> <constant name="struts.convention.result.path" value="/WEB-INF/jsp" />
>> >> <constant name="struts.enable.SlashesInActionNames" value="true" />
>> >> <constant name="struts.convention.package.locators" value="action" />
>> >>
>> >>
>> >> <package name="default" extends="struts-default">
>> >>
>> >>
>> >> <action name="region/*" class="com.action.RegionAction" >
>> >> <param name="name">{0}</param>
>> >> </action>
>> >> </struts>
>> >>
>> >>
>> >> My action
>> >>
>> >> package com.action ;
>> >>
>> >> @Results({
>> >> @Result(name="get", location="region/displayRegion.jsp")
>> >> })
>> >> public class RegionAction extends ActionSupport {
>> >>
>> >>
>> >> private String name ;
>> >> private int id ;
>> >>
>> >>
>> >> public String get(){
>> >> …..
>> >> return "get" ;
>> >> }
>> >>
>> >>
>> >> // name & id getters and setters …...
>> >> }
>> >>
>> >>
>> >> I am trying to get the URL into the state like as the documentation claims it can handle
>> >>
>> >>
>> >> http://HOST/ACTION_NAME/PARAM_NAME1/PARAM_VALUE1/PARAM_NAME2/PARAM_VALUE2
>> >>
>> >>
>> >> So My URL would be like...
>> >>
>> >>
>> >> http://127.0.0.1:8080/region/name/Mexico/id/2
>> >>
>> >>
>> >> But that is not working out. Is there something I have missed?
>> >>
>> >>
>> >> Many thanks
>> >>
>> >>
>> >> _________________________________________________________________
>> >> Hotmail® has a new way to see what's up with your friends.
>> >> http://windowslive.com/Tutorial/Hotmail/WhatsNew?ocid=TXT_TAGLM_WL_HM_Tutorial_WhatsNew1_052009
>> >
>> > _________________________________________________________________
>> > Hotmail® has a new way to see what's up with your friends.
>> > http://windowslive.com/Tutorial/Hotmail/WhatsNew?ocid=TXT_TAGLM_WL_HM_Tutorial_WhatsNew1_052009
>>
>>
>>
>> --
>> "Hey you! Would you help me to carry the stone?" Pink Floyd
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>
> _________________________________________________________________
> Hotmail® has a new way to see what's up with your friends.
> http://windowslive.com/Tutorial/Hotmail/WhatsNew?ocid=TXT_TAGLM_WL_HM_Tutorial_WhatsNew1_052009



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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


RE: Problems setting attributes on my Action using Restful2ActionMapper

Posted by David Rocks <ro...@hotmail.com>.
The documentation was pretty misleading, I wasted a few hours just chasing stuff on the web, in the end it came down to just stepping through the code.

 

I tried to get the convention plugin working first but could not work out how to get that to work with my application although I never looked at the code for that.

 

I am surprised that the REST stuff is quite low key with struts2, or that is the way it seems to me, it really is a make or break for my application/site as the URLs will need to get favourably viewed by google for it to work out.

 

I am quite happy to knock up a small test app and write a doc on this for the WIKI. Can I just apply for a 'CLA'?

 

David

 


 
> Date: Fri, 8 May 2009 14:13:02 -0400
> Subject: Re: Problems setting attributes on my Action using Restful2ActionMapper
> From: musachy@gmail.com
> To: user@struts.apache.org
> 
> That part has always lacked good documentation. I have never used
> myself so I have no idea how it works. You can submit a CLA and get
> edit right to the wiki.
> 
> musachy
> 
> On Fri, May 8, 2009 at 1:00 PM, David Rocks <ro...@hotmail.com> wrote:
> >
> > Hi,
> >
> >
> >
> > managed to get this kind of working although I am constrained to callin in my action the the names of the methods hard coded in the Restful2ActionMapper class.
> >
> >
> >
> > Firstly I have to set...
> >
> >
> >
> > struts.mapper.alwaysSelectFullNamespace=false
> > struts.mapper.idParameterName=entityName  <-- the name of the parameter to be set in the action class
> >
> >
> >
> > Also the documentation is wrong, it is not
> >
> >
> >
> >  http://HOST/ACTION_NAME/PARAM_NAME1/PARAM_VALUE1/PARAM_NAME2/PARAM_VALUE2
> >
> >
> >
> > but
> >
> >
> >
> >  http://HOST/PARAM_NAME2/PARAM_VALUE2/ACTION_NAME/PARAM_VALUE1
> >
> >
> >
> > In the ACTION_NAME part I cannot set the action and the method name, i just have to set the action name and it picks up the view method.
> >
> >
> >
> > so it has to be
> >
> >
> >
> > http://127.0.0.1:8080/myApp/region/England -> that goes to view and puts the value of england into entityName  as shown above
> >
> >
> >
> > I cannot force it to go to a get method like
> >
> >
> >
> > http://127.0.0.1:8080/myApp/region/get/England   -> which calls get and sets entityName
> >
> >
> >
> > I would be quite happy to set @action( "region/get" ) on my action method.
> >
> >
> >
> > So the docs could be updated and if someone knows how to set the method and action name in a rest URL using Restful2ActionMapper  then I am all ears.
> >
> >
> >
> > Thanks
> >
> >
> >
> > David
> >
> >
> >
> >
> >> From: rocks_david@hotmail.com
> >> To: user@struts.apache.org
> >> Subject: Problems setting attributes on my Action using Restful2ActionMapper
> >> Date: Thu, 7 May 2009 15:40:30 +0000
> >>
> >>
> >> Hi,
> >>
> >>
> >> I am trying to work out how populate attributes on using Restful2ActionMapper but I think I am missing something in my configuration and wondered if someone could give me some advice.
> >>
> >>
> >> My struts file is
> >>
> >>
> >> <struts>
> >> <constant name="struts.mapper.class" value="restful2" />
> >> <constant name="struts.convention.result.path" value="/WEB-INF/jsp" />
> >> <constant name="struts.enable.SlashesInActionNames" value="true" />
> >> <constant name="struts.convention.package.locators" value="action" />
> >>
> >>
> >> <package name="default" extends="struts-default">
> >>
> >>
> >> <action name="region/*" class="com.action.RegionAction" >
> >> <param name="name">{0}</param>
> >> </action>
> >> </struts>
> >>
> >>
> >> My action
> >>
> >> package com.action ;
> >>
> >> @Results({
> >> @Result(name="get", location="region/displayRegion.jsp")
> >> })
> >> public class RegionAction extends ActionSupport {
> >>
> >>
> >> private String name ;
> >> private int id ;
> >>
> >>
> >> public String get(){
> >> …..
> >> return "get" ;
> >> }
> >>
> >>
> >> // name & id getters and setters …...
> >> }
> >>
> >>
> >> I am trying to get the URL into the state like as the documentation claims it can handle
> >>
> >>
> >> http://HOST/ACTION_NAME/PARAM_NAME1/PARAM_VALUE1/PARAM_NAME2/PARAM_VALUE2
> >>
> >>
> >> So My URL would be like...
> >>
> >>
> >> http://127.0.0.1:8080/region/name/Mexico/id/2
> >>
> >>
> >> But that is not working out. Is there something I have missed?
> >>
> >>
> >> Many thanks
> >>
> >>
> >> _________________________________________________________________
> >> Hotmail® has a new way to see what's up with your friends.
> >> http://windowslive.com/Tutorial/Hotmail/WhatsNew?ocid=TXT_TAGLM_WL_HM_Tutorial_WhatsNew1_052009
> >
> > _________________________________________________________________
> > Hotmail® has a new way to see what's up with your friends.
> > http://windowslive.com/Tutorial/Hotmail/WhatsNew?ocid=TXT_TAGLM_WL_HM_Tutorial_WhatsNew1_052009
> 
> 
> 
> -- 
> "Hey you! Would you help me to carry the stone?" Pink Floyd
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 

_________________________________________________________________
Hotmail® has a new way to see what's up with your friends.
http://windowslive.com/Tutorial/Hotmail/WhatsNew?ocid=TXT_TAGLM_WL_HM_Tutorial_WhatsNew1_052009