Re: NPE when running unit test with struts rest plugin

2020-11-09 Thread Lukasz Lenart
pon., 9 lis 2020 o 14:38 Paul Zepernick napisał(a): > > Thank you very much, this has resolved the issue! I have created a ticket in > Jira. > > https://issues.apache.org/jira/browse/WW-5095 Great, thanks a lot! Regards -- Łukasz + 48 606 323 122 http://www.lenart.org.pl/ --

RE: NPE when running unit test with struts rest plugin

2020-11-09 Thread Paul Zepernick
: Saturday, November 7, 2020 8:51 AM To: Struts Users Mailing List Subject: Re: NPE when running unit test with struts rest plugin NOTICE: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe. śr

Re: NPE when running unit test with struts rest plugin

2020-11-07 Thread Lukasz Lenart
śr., 4 lis 2020 o 17:29 Paul Zepernick napisał(a): > I have posted an example project that reproduces the error in the junit test > > https://github.com/zepernick/struts25-rest-junit I think I have found the problem, mapping is not set in getActionProxy(), you can fix it by overriding it like thi

RE: NPE when running unit test with struts rest plugin

2020-11-04 Thread Paul Zepernick
Sent: Tuesday, November 3, 2020 2:42 PM To: Struts Users Mailing List Subject: RE: NPE when running unit test with struts rest plugin NOTICE: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe

RE: NPE when running unit test with struts rest plugin

2020-11-03 Thread Paul Zepernick
To: Struts Users Mailing List Subject: Re: NPE when running unit test with struts rest plugin NOTICE: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe. wt., 3 lis 2020 o 13:24 Paul

Re: NPE when running unit test with struts rest plugin

2020-11-03 Thread Lukasz Lenart
wt., 3 lis 2020 o 13:24 Paul Zepernick napisał(a): > Yes, I am using the struts2-junit plugin and extending > StrutsSpringJUnit4TestCase from the plugin. Would you mind preparing a small example and put it on Github? Regards -- Łukasz + 48 606 323 122 http://www.lenart.org.pl/ --

RE: NPE when running unit test with struts rest plugin

2020-11-03 Thread Paul Zepernick
, November 3, 2020 1:16 AM To: Struts Users Mailing List Subject: Re: NPE when running unit test with struts rest plugin NOTICE: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe. pon., 2 lis 2020

Re: NPE when running unit test with struts rest plugin

2020-11-02 Thread Lukasz Lenart
pon., 2 lis 2020 o 14:48 Paul Zepernick napisał(a): > Struts: 5.2.25 > > Plugins: struts2-rest, struts2-spring, struts2-convention > junit 4 > > Did you try to use struts2-junit plugin and based your tests on StrutsJUnit4TestCase? https://struts.apache.org/plugins/junit/ Regards -- Łukasz + 48

NPE when running unit test with struts rest plugin

2020-11-02 Thread Paul Zepernick
Struts: 5.2.25 Plugins: struts2-rest, struts2-spring, struts2-convention junit 4 The test below is currently failing in the RestWorkflowInterceptor 205 @Test public void testValidation() throws Exception { // the login uses the create() which expects the POST method reque

Re: How to Strtus2-Rest plugin could create /user/{id}/{branch} URL Pattern

2019-05-15 Thread Lukasz Lenart
niedz., 12 maj 2019 o 07:49 M Huzaifah napisał(a): > > Dear All, > > i’am stuck how to create /user/{id}/{branch}/{xx} URL Pattern using > Struts-convention and Struts2-rest plugin. > there is a way to make it done? The REST plugin doesn't support such configuration n

How to Strtus2-Rest plugin could create /user/{id}/{branch} URL Pattern

2019-05-11 Thread M Huzaifah
Dear All, i’am stuck how to create /user/{id}/{branch}/{xx} URL Pattern using Struts-convention and Struts2-rest plugin. there is a way to make it done? I knew it can be done by using advance wildcard in our struts xml as mention in here https://struts.apache.org/core-developers/wildcard

Re: Support for sub-resources in struts 2 rest plugin

2019-03-21 Thread DevaGerald
Any update on this requirement? Or atleast any workaround? -- Sent from: http://struts.1045723.n5.nabble.com/Struts-User-f3426046.html - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mai

Re: Help : Disable Strict Method Invocation for struts 2 rest plugin

2018-04-30 Thread Yasser Zamani
le. However, in this issue, convention is used and struts.xml doesn't have any defined action. Did you mean convention's @action annotation doesn't work with rest i.e. does not automatically define allowed methods with that annotation? > The same should happen with the REST plu

Re: Support for sub-resources in struts 2 rest plugin

2018-04-30 Thread DevaGerald
I have created a new ticket. https://issues.apache.org/jira/browse/WW-4935 Thanks, Deva. -- Sent from: http://struts.1045723.n5.nabble.com/Struts-User-f3426046.html - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org

Re: Support for sub-resources in struts 2 rest plugin

2018-04-30 Thread Lukasz Lenart
This isn't supported right now. I think it would be good re-use @Action annotation ro define a new (e.g. @Resource) to allow define custom paths. Could you register a ticket? 2018-04-29 15:55 GMT+02:00 DevaGerald : > Thanks for your reply. > > I am already using struts-2 rest plugin

Re: Help : Disable Strict Method Invocation for struts 2 rest plugin

2018-04-29 Thread Lukasz Lenart
solution to keep both security and all methods allowed. The problem is that we should support existing configurations (like automatically define allowed methods for those used in struts.xml). The same should happen with the REST plugin but the problem is that i tries to guess the method name based on ur

Re: Support for sub-resources in struts 2 rest plugin

2018-04-29 Thread DevaGerald
Thanks for your reply. I am already using struts-2 rest plugin in production. What we are trying to solve here, is a hierarchical resource entity API implementation. Let me give an example of what I am trying to do. For getting an organization info, we can use a REST API like /organizations

Re: Help : Disable Strict Method Invocation for struts 2 rest plugin

2018-04-29 Thread DevaGerald
Hi Yasser, We already have a layer of security(a filter which runs first in our web-app) which handles allowed url patterns. So in this we have to again add code for allowed methods. So we are trying to get an option to disable it. Thanks, Deva. -- Sent from: http://struts.1045723.n5.nabble.c

Re: Help : Disable Strict Method Invocation for struts 2 rest plugin

2018-04-29 Thread Yasser Zamani
On 4/26/2018 4:03 PM, Lukasz Lenart wrote: > Thinking on solution ... not so easy :( I couldn't understand what's the user expected behavior and what we should try to fix. Because of security, SMI is enabled by default and user has to annotate or define allowed methods. right? I think there are

Re: Support for sub-resources in struts 2 rest plugin

2018-04-29 Thread Yasser Zamani
On 4/27/2018 11:45 AM, DevaGerald wrote: > Hi, > > Sorry if i miss something here. As of my knowledge, the struts 2 rest plugin > supports only the following : > /resource - GET > /resource - POST > /resource/$resource_id - GET > /resource/$resource_id - PUT > /res

Re: Help : Disable Strict Method Invocation for struts 2 rest plugin

2018-04-28 Thread DevaGerald
Thanks for the reply. We will use the existing (regex in global-allowed-methods) solution till that. -- Sent from: http://struts.1045723.n5.nabble.com/Struts-User-f3426046.html - To unsubscribe, e-mail: user-unsubscr...@struts.

Support for sub-resources in struts 2 rest plugin

2018-04-27 Thread DevaGerald
Hi, Sorry if i miss something here. As of my knowledge, the struts 2 rest plugin supports only the following : /resource - GET /resource - POST /resource/$resource_id - GET /resource/$resource_id - PUT /resource/$resource_id - DELETE and also the custom methods like /resource/$resource_id

Re: Help : Disable Strict Method Invocation for struts 2 rest plugin

2018-04-26 Thread Lukasz Lenart
Thinking on solution ... not so easy :( 2018-04-26 13:24 GMT+02:00 DevaGerald : > Any update on this? > > > > -- > Sent from: http://struts.1045723.n5.nabble.com/Struts-User-f3426046.html > > - > To unsubscribe, e-mail: user-unsub

Re: Help : Disable Strict Method Invocation for struts 2 rest plugin

2018-04-26 Thread DevaGerald
Any update on this? -- Sent from: http://struts.1045723.n5.nabble.com/Struts-User-f3426046.html - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org

Re: Help : Disable Strict Method Invocation for struts 2 rest plugin

2018-04-19 Thread DevaGerald
http://struts.apache.org/dtds/struts-2.5.dtd";> regex:[a-zA-Z]* -- Sent from: http://struts.1045723.n5.nabble.com/Struts-Us

Re: Help : Disable Strict Method Invocation for struts 2 rest plugin

2018-04-19 Thread Lukasz Lenart
2018-04-19 8:58 GMT+02:00 DevaGerald : > Just a clarification. May be my point was misunderstood. > > Ex : /resource/resource_id/hello > This will call the hello method of my controller. > REST plugin directly maps to my custom method. In this case, it calls the >

Re: Help : Disable Strict Method Invocation for struts 2 rest plugin

2018-04-19 Thread DevaGerald
Just a clarification. May be my point was misunderstood. Ex : /resource/resource_id/hello This will call the hello method of my controller. REST plugin directly maps to my custom method. In this case, it calls the hello method of my ResourceController. What will be the best solution for this

Re: Help : Disable Strict Method Invocation for struts 2 rest plugin

2018-04-18 Thread Lukasz Lenart
Here https://issues.apache.org/jira/projects/WW/issues 2018-04-18 15:04 GMT+02:00 DevaGerald : > Sorry if I am so dumb. Where should i file the ticket? > > > > -- > Sent from: http://struts.1045723.n5.nabble.com/Struts-User-f3426046.html > >

Re: Help : Disable Strict Method Invocation for struts 2 rest plugin

2018-04-18 Thread DevaGerald
Sorry if I am so dumb. Where should i file the ticket? -- Sent from: http://struts.1045723.n5.nabble.com/Struts-User-f3426046.html - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: us

Re: Help : Disable Strict Method Invocation for struts 2 rest plugin

2018-04-18 Thread Lukasz Lenart
2018-04-18 9:15 GMT+02:00 DevaGerald : > Yes i have configured rest plugin for that Ach... so we must fix allowed-methods to include those REST methods, could you fill a ticket? Regards -- Łukasz + 48 606 323 122 http://www.lenart.org

Re: Help : Disable Strict Method Invocation for struts 2 rest plugin

2018-04-18 Thread DevaGerald
Yes i have configured rest plugin for that -- Sent from: http://struts.1045723.n5.nabble.com/Struts-User-f3426046.html - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h

Re: Help : Disable Strict Method Invocation for struts 2 rest plugin

2018-04-15 Thread Lukasz Lenart
2018-04-14 11:58 GMT+02:00 DevaGerald : > I don't use DMI. I have the following configured in struts.xml. > > > So is there any other way for me to disable strict method invocation? I am > just using struts 2 rest plugin. Hm... so how do you call those custom methods? Did y

Re: Help : Disable Strict Method Invocation for struts 2 rest plugin

2018-04-14 Thread Yasser Zamani
On 4/11/2018 11:11 AM, Lukasz Lenart wrote: > 2018-04-09 16:59 GMT+02:00 DevaGerald : >> Thanks a lot Lukasz. >> >> I have resolved it by adding >> regex:[a-zA-Z]* in my >> struts.xml >> >> Do I have any alternative for this? > > No but I didn't want to suggest this as this basically opens a > p

Re: Help : Disable Strict Method Invocation for struts 2 rest plugin

2018-04-14 Thread DevaGerald
I don't use DMI. I have the following configured in struts.xml. So is there any other way for me to disable strict method invocation? I am just using struts 2 rest plugin. Thanks & Regards Deva. -- Sent from: http://struts.1045723.n5.nabble.com/Struts-User-f342

Re: Help : Disable Strict Method Invocation for struts 2 rest plugin

2018-04-10 Thread Lukasz Lenart
2018-04-09 16:59 GMT+02:00 DevaGerald : > Thanks a lot Lukasz. > > I have resolved it by adding > regex:[a-zA-Z]* in my > struts.xml > > Do I have any alternative for this? No but I didn't want to suggest this as this basically opens a potential security hole in your app. In this case any public m

Re: Help : Disable Strict Method Invocation for struts 2 rest plugin

2018-04-09 Thread DevaGerald
Thanks a lot Lukasz. I have resolved it by adding regex:[a-zA-Z]* in my struts.xml Do I have any alternative for this? Thanks & Regards, Deva Gerald. -- Sent from: http://struts.1045723.n5.nabble.com/Struts-User-f3426046.html --

Re: Help : Disable Strict Method Invocation for struts 2 rest plugin

2018-04-08 Thread Lukasz Lenart
2018-04-07 16:18 GMT+02:00 DevaGerald : > I am using Struts 2 with rest plugin and I need to migrate from struts 2.3 to > struts 2.5. My application also has struts 1 with the older apis unmigrated > to struts2. > > I have some custom methods in my application other than t

Help : Disable Strict Method Invocation for struts 2 rest plugin

2018-04-07 Thread DevaGerald
I am using Struts 2 with rest plugin and I need to migrate from struts 2.3 to struts 2.5. My application also has struts 1 with the older apis unmigrated to struts2. I have some custom methods in my application other than the default CRUD operations. As the strict method invocation is enabled now

[ANN] A crafted XML request can be used to perform a DoS attack when using the Struts REST plugin

2018-03-27 Thread Lukasz Lenart
The Apache Security Struts Team recommends to immediately upgrade your Struts 2 based projects to use the latest released version of the Apache Struts. This is necessary to prevent your publicly accessible web site, which is using the Struts REST plugin and performing XML serialisation, from being

Re: Unable to integrate struts2-rest-plugin in existing maven structure

2017-12-02 Thread Yasser Zamani
On 12/1/2017 7:13 PM, Adam Brin wrote: > Apologies if I missed something earlier, but can you do a dependency search > in your project and see if you already have a version of net.sf.json.lib > included elsewhere? perhaps an older (or newer) version is conflicting? > Also see your published a

Re: Unable to integrate struts2-rest-plugin in existing maven structure

2017-12-01 Thread Adam Brin
Apologies if I missed something earlier, but can you do a dependency search in your project and see if you already have a version of net.sf.json.lib included elsewhere? perhaps an older (or newer) version is conflicting? -- _ Adam Brin Dire

Re: Unable to integrate struts2-rest-plugin in existing maven structure

2017-12-01 Thread preetam1...@gmail.com
Yes, i tried jdk15 as well jdk13 On 2017-12-01 18:17, Yasser Zamani wrote: > > > On 12/1/2017 3:50 PM, PATIL Preetam wrote: > > > > net.sf.json-lib > > json-lib > > 2.4 > > > > C

Re: Unable to integrate struts2-rest-plugin in existing maven structure

2017-12-01 Thread preetam1...@gmail.com
Also tried by upgrading rest-plug in version. org.apache.struts struts2-rest-plugin 2.5 It gives new type of error ERROR InterceptorBuilder - Actual exception Could not load class

Re: Unable to integrate struts2-rest-plugin in existing maven structure

2017-12-01 Thread Lukasz Lenart
org.apache.struts > struts2-core > 2.3.24.1 > > > > > org.apache.struts > strut

Unable to integrate struts2-rest-plugin in existing maven structure

2017-12-01 Thread preetam1...@gmail.com
I am trying add struts2-rest-plugin to existing application. But getting below errors. I am tried all possible option but no use! Caused by: Unable to load bean: type:org.apache.struts2.rest.handler.ContentTypeHandler class:org.apache.struts2.rest.handler.JsonLibHandler - bean - jar:file:/C

Re: Unable to integrate struts2-rest-plugin in existing maven structure

2017-12-01 Thread preetam1...@gmail.com
org.apache.struts struts2-rest-plugin 2.3.24.1 org.apache.struts struts2-convention-plugin

Re: Unable to integrate struts2-rest-plugin in existing maven structure

2017-12-01 Thread Yasser Zamani
On 12/1/2017 3:50 PM, PATIL Preetam wrote: > > net.sf.json-lib > json-lib > 2.4 > Could you try jdk15 i.e. net.sf.json-lib json-lib 2.4 jdk1

RE: Unable to integrate struts2-rest-plugin in existing maven structure

2017-12-01 Thread PATIL Preetam
struts2-core 2.3.24.1 org.apache.struts struts2-rest-plugin 2.3.24.1 org.apache.struts

Re: Unable to integrate struts2-rest-plugin in existing maven structure

2017-12-01 Thread Lukasz Lenart
2017-12-01 12:26 GMT+01:00 PATIL Preetam : > Hello, > > I am trying add struts2-rest-plugin to existing application. tried all > possible option but no use.! > I am new to maven related stuff, > > Getting below errors. > > Caused by: Unable to load bean:

Unable to integrate struts2-rest-plugin in existing maven structure

2017-12-01 Thread PATIL Preetam
Hello, I am trying add struts2-rest-plugin to existing application. tried all possible option but no use.! I am new to maven related stuff, Getting below errors. Caused by: Unable to load bean: type:org.apache.struts2.rest.handler.ContentTypeHandler class:org.apache.struts2

Issue with Struts2 Submit action attribute in Struts2 and Rest Plugin

2017-02-28 Thread Kiran Kongala
Hi, I have a Enterprise java application and we are using Struts1.2 & struts2-core-2.3.14.jar and everything is fine. But now I want to use the Rest Plugin and I copied the rest plugin (struts2-rest-plugin-2.3.14.jar) and made the below changes in the Struts.xml file. Currently I am not u

Re: [Question] [struts2-rest-plugin] How shall I handle GET request /orders/{id}/items?

2016-09-07 Thread Ken McWilliams
-use-wildcard-method-invocation-in-struts2-with-conventions-plu Since you may need to resolve the child entity before fetching the child, it might be convenient to have them in the same class... save you from chaining. Create/Update/Delete using the struts2-rest-plugin are pretty straight forward but

[Question] [struts2-rest-plugin] How shall I handle GET request /orders/{id}/items?

2016-09-07 Thread Yong Kang Guo
Hi experts, I'm learning to use the struts2-rest-plugin. In the sample project 'rest-showcase', I see a good example where I can GET /orders and /orders/1. But how to implement navigation from one resource to another? E.g., Let's say an Order has many Items. Then how to

Re: struts2-rest-plugin issues getting non-restful urls to cooperate

2016-06-30 Thread Aleksandr Mashchenko
Hey Ken, Can you be more specific about PUT method isn't working like it should? (some code, links to SO questions) >Struts2 has ActionSupport, it would be nice if similar interfaces already existed for the rest-result type Actually there is RestActionSupport - https://github.com/apache/st

Re: struts2-rest-plugin issues getting non-restful urls to cooperate

2016-06-29 Thread Ken McWilliams
ented org.apache.struts2.rest.handler.ContentTypeHandler to use FlexJson. So a couple observations as a first time user of the struts2-rest-plugin: - I like the Idea of this extension of conventions, adding constraints can make you think along certain tried and true methods and make work faster. - It would be

RE: struts2-rest-plugin issues getting non-restful urls to cooperate

2016-05-30 Thread Martin Gainty
> From: lukaszlen...@apache.org > Date: Mon, 30 May 2016 08:18:28 +0200 > Subject: Re: struts2-rest-plugin issues getting non-restful urls to cooperate > To: user@struts.apache.org > > 2016-05-27 17:41 GMT+02:00 Ken McWilliams : > > I got it working but I think the doc

Re: struts2-rest-plugin issues getting non-restful urls to cooperate

2016-05-29 Thread Lukasz Lenart
2016-05-27 17:41 GMT+02:00 Ken McWilliams : > I got it working but I think the documentation could be made with more > "hand holding". I'll post a "How to set up struts2 with conventions and > both restful and non-restful urls". Then self-answer the question this > weekend with all the configurati

Re: struts2-rest-plugin issues getting non-restful urls to cooperate

2016-05-27 Thread Ken McWilliams
I got it working but I think the documentation could be made with more "hand holding". I'll post a "How to set up struts2 with conventions and both restful and non-restful urls". Then self-answer the question this weekend with all the configuration and project set-up steps and then post the link h

RE: struts2-rest-plugin issues getting non-restful urls to cooperate

2016-05-26 Thread Aleksandr Mashchenko
Working fine in my project. Can you show your project configuration? --- Regards, Aleksandr - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org

struts2-rest-plugin issues getting non-restful urls to cooperate

2016-05-24 Thread Ken McWilliams
I'm following these instructions to get restful and non-restful urls to cooperate: http://struts.apache.org/docs/rest-plugin.html#RESTPlugin-RESTandnon-RESTfulURL%27sTogetherConfiguration Having followed the instructions on that page I've been able to set up a project _only_ containing restful ur

RE: Using Struts2 Rest Plugin with deep cascading actions

2015-01-26 Thread Martin Gainty
} else return -1; } }); Thoughts? Martin ----- The key to prevent a hacked email account is to change password more than every 5 years.. > From: mgai...@hotmail.

RE: Using Struts2 Rest Plugin with deep cascading actions

2015-01-24 Thread Martin Gainty
> Date: Sat, 24 Jan 2015 15:24:49 +0530 > Subject: Re: Using Struts2 Rest Plugin with deep cascading actions > From: ghotankaru...@gmail.com > To: user@struts.apache.org > > Well after doing some research on designing rest api ***best practices*** I > realized I was

Re: Using Struts2 Rest Plugin with deep cascading actions

2015-01-24 Thread Amol Ghotankar
o use http://localhost/location instead of http://localhost/company/location Please suggest. On Fri, Jan 23, 2015 at 4:20 PM, Amol Ghotankar wrote: > hi, > > I was trying out struts2 rest plugin and found it really cool. > > But was just wondering how will this work with action cascadin

Using Struts2 Rest Plugin with deep cascading actions

2015-01-23 Thread Amol Ghotankar
hi, I was trying out struts2 rest plugin and found it really cool. But was just wondering how will this work with action cascading ? i.e So When using http://localhost/company it goes to companyAction and executes respective mapped methods But how do we organize work when we http://localhost

Re: REST Plugin with convention plugin

2013-07-10 Thread Lukasz Lenart
2013/7/10 Alireza Fattahi : > Hi, > > I am trying to use REST Plugin with convention plugin . > > For all REST actions I should extend RestActionMapper, After I extend > RestActionMapper instead of ActionSuppor, the convention plugin those not > find the action any more ! C

REST Plugin with convention plugin

2013-07-10 Thread Alireza Fattahi
Hi, I am trying to use REST Plugin with convention plugin . For all REST actions I should extend RestActionMapper, After I extend RestActionMapper instead of ActionSuppor, the convention plugin those not find the action any more !   ~Regards, ~~Alireza Fattahi

Re: config-browser with rest plugin

2012-12-08 Thread Lukasz Lenart
2012/12/8 Lukasz Lenart : > You can use !execute as the REST plugin expects index() instead of > execute() - see below, but the change is quite easy, please register > an issue. > > http://localhost:8080/struts2-rest-showcase/config-browser/showConfig!execute.xhtml?namespace=&am

Re: config-browser with rest plugin

2012-12-08 Thread Lukasz Lenart
2012/12/5 ChadDavis : > Would you expect the config-browser plugin to work with the rest-plugin? > When I add the rest plugin, the config-browser/index.action page no longer > resolves. You can use !execute as the REST plugin expects index() instead of execute() - see below, but the

Re: Struts2 Rest Plugin

2012-12-03 Thread Lukasz Lenart
2012/11/30 Davis, Chad : > >> I think, the basic idea was to allow cooperate the REST plugin with the >> Convention plugin and code behind is a deprecated plugin that will be >> discarded soon (with 3.x) > > 1) So, it doesn't "depend" on it, in any technic

RE: Struts2 Rest Plugin

2012-11-30 Thread Davis, Chad
> I think, the basic idea was to allow cooperate the REST plugin with the > Convention plugin and code behind is a deprecated plugin that will be > discarded soon (with 3.x) 1) So, it doesn't "depend" on it, in any technical sense? 2) But it's made to work with t

Re: Struts2 Rest Plugin

2012-11-30 Thread Lukasz Lenart
2012/11/28 Davis, Chad : > The docs for the REST plugin talk about how it builds on the Convention > plugin ( sometimes it says "code behind" ). However, I don't see that using > the REST plugin pulls in either of these plugins . . . in what sense does it > "bui

Re: Struts2 Rest Plugin

2012-11-28 Thread Ken McWilliams
n Wed, Nov 28, 2012 at 2:04 PM, Davis, Chad wrote: > Hi! > > The docs for the REST plugin talk about how it builds on the Convention > plugin ( sometimes it says "code behind" ). However, I don't see that > using the REST plugin pulls in either of these plugins . . .

Struts2 Rest Plugin

2012-11-28 Thread Davis, Chad
Hi! The docs for the REST plugin talk about how it builds on the Convention plugin ( sometimes it says "code behind" ). However, I don't see that using the REST plugin pulls in either of these plugins . . . in what sense does it "build" on them? Thanks, Chad

Re: Struts2 with rest-plugin: Map JSON value to ENUM

2012-10-17 Thread Lukasz Lenart
2012/10/12 Shaun Lim : > I'm using Struts2 with the rest-plugin to build a RESTful web services. > Serializing from Java objects to JSON was a breeze - everything mapped > correctly and beautifully. Receiving JSON and attempting to map it to Java > objects is a whole different

Struts2 with rest-plugin: Map JSON value to ENUM

2012-10-11 Thread Shaun Lim
Hello all, I'm using Struts2 with the rest-plugin to build a RESTful web services. Serializing from Java objects to JSON was a breeze - everything mapped correctly and beautifully. Receiving JSON and attempting to map it to Java objects is a whole different issue. I ran into 2 problem

Re: Struts2 REST plugin: Passing array in JSON

2012-10-11 Thread Shaun Lim
Hi Chris, It's just: Method public java.lang.String org.apache.commons.lang.exception.NestableRuntimeException.getMessage(int) threw an exception when invoked on net.sf.json.JSONException: Error while setting property=arrayListStr type interface java.util.List The program crapped out in JsonLibH

Re: Struts2 REST plugin: Passing array in JSON

2012-10-11 Thread Chris Pratt
I was more looking for the output of all the System.out.println's (*Chris*) On Oct 11, 2012 12:40 PM, "Shaun Lim" wrote: > By the way, mapping to a simple String[] works, but I'm finding it hard to > believe that the plugin does not know how to handle conversions to List.. > > On Thu, Oct 11, 2

Re: Struts2 REST plugin: Passing array in JSON

2012-10-11 Thread Lukasz Lenart
2012/10/11 Shaun Lim : > By the way, mapping to a simple String[] works, but I'm finding it hard to > believe that the plugin does not know how to handle conversions to List.. Could you prepare a full Maven base example ? Thanks in advance -- Łukasz + 48 606 323 122 http://www.lenart.org.pl/ -

Re: Struts2 REST plugin: Passing array in JSON

2012-10-11 Thread Shaun Lim
By the way, mapping to a simple String[] works, but I'm finding it hard to believe that the plugin does not know how to handle conversions to List.. On Thu, Oct 11, 2012 at 11:54 AM, Shaun Lim wrote: > Method public java.lang.String > org.apache.commons.lang.exception.NestableRuntimeException.ge

Re: Struts2 REST plugin: Passing array in JSON

2012-10-11 Thread Shaun Lim
Method public java.lang.String org.apache.commons.lang.exception.NestableRuntimeException.getMessage(int) threw an exception when invoked on net.sf.json.JSONException: Error while setting property=arrayListStr type interface java.util.List On Thu, Oct 11, 2012 at 11:19 AM, Chris Pratt wrote: > W

Re: Struts2 REST plugin: Passing array in JSON

2012-10-11 Thread Chris Pratt
What's the output of the run with this class & JSON? (*Chris*) On Thu, Oct 11, 2012 at 10:52 AM, Shaun Lim wrote: > Hi Chris, > > I did start off with a List implementation but started changing > stuff around in futile attempts to get something working. Anyway I tried > your suggestion, and am

Re: Struts2 REST plugin: Passing array in JSON

2012-10-11 Thread Shaun Lim
Hi Chris, I did start off with a List implementation but started changing stuff around in futile attempts to get something working. Anyway I tried your suggestion, and am still getting the same error: //I've a whole bunch of different fields here cause i was testing various things, but "arrayList

Re: Struts2 REST plugin: Passing array in JSON

2012-10-10 Thread Chris Pratt
You *might* need to initialize the countries array. I wouldn't be surprised if internally the JSON library is doing a getCountries().add("CA") and throwing a null pointer exception because getCountries is returning a null. Also, you should really be programming to interfaces, not implementations.

Struts2 REST plugin: Passing array in JSON

2012-10-10 Thread Shaun Lim
My entity class: import java.util.ArrayList; public class Test { private String name; private String description; private ArrayList countries; public Test() { } public String getName() { return name; } public void setName(String name) { this.na

Re: Struts 2 Rest plugin without automatic configuration of both actions and results

2012-10-10 Thread Frans Thamura
without automatic configuration. But > recently planned to implement REST plugin. When read the docs it is > provided that it will work on autoconfiguration. But is there any way to > override it. > > Such as to use current struts.xml for mappings with new REST urls and its > formats a

Re: Does REST plugin support complex RESTful URLs?

2012-03-08 Thread lupestro
been introduced since then that is more akin to what Rails, Spring MVC, and ASP.NET MVC do? I know it would be easy with that sort of annotation. Ralph -- View this message in context: http://struts.1045723.n5.nabble.com/Does-REST-plugin-support-complex-RESTful-

Does REST plugin support complex RESTful URLs?

2012-03-08 Thread Ralph Mack
The REST plugin seems to address the vanilla cases of restful URLs: - /hair/bears/furbolg - /hair/bears/furbolg/1 or even my preferred form - /hair/bears/furbolg/firbolg-1 If I have a FurbolgController (or FurbolgAction) and define the right methods, it works like magic. However, following

Re: struts-rest-plugin 2.2.3 result from POST

2011-11-28 Thread kva
Tracked here https://issues.apache.org/jira/browse/WW-3713 -- View this message in context: http://struts.1045723.n5.nabble.com/struts-rest-plugin-2-2-3-result-from-POST-tp4469274p5029137.html Sent from the Struts - User mailing list archive at Nabble.com

Re: rest-plugin: paramPrepareParam + Namespaces

2011-08-30 Thread Dave Newton
On Tue, Aug 30, 2011 at 1:25 PM, M. Rakowski wrote: > 1) paramPrepareParam-Stack: > It seems that the rest plugin does not support paramPrepareParam-Stack. Define "support"; the REST plugin defines its own interceptor stack [1] and if you're modifying it you'll

rest-plugin: paramPrepareParam + Namespaces

2011-08-30 Thread M. Rakowski
i have some questions about the rest-plugin: 1) paramPrepareParam-Stack: It seems that the rest plugin does not support paramPrepareParam-Stack. The setId-method is always called after the prepare-Method. Is the only way to solve it to use the query string (action?id=xy instead of action/xy

Re: Struts2 REST plugin problems

2011-07-05 Thread Łukasz Lenart
2011/7/4 Aelbery Lee : > Yes. I had set "struts.rest.namespace" in the struts.xml to "/ws". It must work, could you show your action's source code ? Do you map like these below: /ws/model -> ModelAction.index() /ws/mode/1 -> ModelAction.show() Regards -- Łukasz + 48 606 323 122 http://www.lena

Re: Struts2 REST plugin problems

2011-07-03 Thread Aelbery Lee
Yes. I had set "struts.rest.namespace" in the struts.xml to "/ws". -- View this message in context: http://struts.1045723.n5.nabble.com/Struts2-REST-plugin-problems-tp3492324p4548572.html Sent from the Struts - User mailing list a

Re: Struts2 REST plugin problems

2011-07-03 Thread Łukasz Lenart
gt; If I removed the PrefixBasedActionMapper and prefixMapping two lines, > /myapp/mymodule works fine with restful action. > > But now /myapp/mymodule raise exception "method not found", execute(); > And /myapp/ws/mymodule raise exception "action not found", ws action. &

Re: Struts2 REST plugin problems

2011-07-02 Thread Aelbery Lee
und", ws action. So I must make a mistake. Thanks for you help. -- View this message in context: http://struts.1045723.n5.nabble.com/Struts2-REST-plugin-problems-tp3492324p4544292.html Sent from the Struts - User mailing l

struts-rest-plugin 2.2.3 result from POST

2011-06-08 Thread kva
Hi, the struts-rest-plugin 2.2.1 allowed for returning results from POST requests in case the status code was anything other than 200 (like CREATED or 201). It appears that 2.2.3 no longer supports this behavior. Method selectTarget() in RestActionInvocation only allows to return results from GET

Re: [REST-PLUGIN] Model not updated on JSON/XML post

2011-05-19 Thread christoe
For future reference and/or if someone else is troubled by this in the future the solution to both of these problems seems to be that I by mistake defined my application to use defaultStack rather than restDefaultStack. -- View this message in context: http://struts.1045723.n5.nabble.com/REST

Re: Serialization of stackTrace in REST-plugin

2011-05-18 Thread Stefan Magnus Landrø
t à 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:

Serialization of stackTrace in REST-plugin

2011-05-18 Thread Stefan Magnus Landrø
Hi there, We are seeing some serialized stacktraces in addition to our custom exception result in our json-output after upgrading to 2.2.3. Is there a way to turn it off? Cheers Stefan -- BEKK Open http://open.bekk.no - To un

[REST-PLUGIN] Model not updated on JSON/XML post

2011-05-16 Thread christoe
Hi, I've developed a solution based on Struts2 and the REST-plugin. Recently I noticed that it's not possible for me to POST/PUT anything to any controller. GET works fine, both jsp/xhml and json/xml. It's also possible to update the model using a form in a jsp. I'm not ge

Struts 2 convention-plugin / rest-plugin

2011-05-03 Thread Stefan Magnus Landrø
Hi there, We're using the Struts 2 convention-plugin in conjunction with the rest-plugin, and are using JSON as the default content-type >From time to time, we get the following in our logs: WARN net.sf.json.JSONObject - Property 'container' has no read method. SKIPPED Howe

  1   2   3   >