Questions tagged [struts2-rest-plugin]

The REST Plugin provides high level support for the implementation of RESTful resource based web applications

The REST Plugin provides high level support for the implementation of RESTful resource based web applications.

The REST plugin can cooperate with the Convention Plugin to support a zero configuration approach to declaring your actions and results, but you can always use the REST plugin with XML style configuration if you like.

REST plugin official documentation

21 questions
7
votes
3 answers

POST request to Struts2 with REST plugin not receiving response

I have a struts2 application which uses the struts2-rest-plugin v.2.2.3. Everything is working great when it comes to the routing of the requests to the actions and its methods and I'm also using ModelDriven to specify the object to serialise when…
noShowP
  • 830
  • 1
  • 11
  • 22
5
votes
1 answer

Action not mapped error using Struts 2 REST plugin

I have written a simple code to integrate rest with Struts 2.3.24 I have my Struts XML:
Harshal
  • 57
  • 2
4
votes
2 answers

Returning response in Struts2 RESTful plugin POST request

I have implemented Struts2 REST API from getting info from here Struts2 Rest Plugin Is there any way to return custom response in in restful plugin in Struts2. I did all the required changes like struts.rest.content.restrictToGET = false Got…
4
votes
1 answer

REST API plugin - use body instead of query string for parameters

I'm using this as a reference to create a REST only configuration on Struts2: https://cwiki.apache.org/confluence/display/WW/REST+Plugin I have one model, Receipt with a few test fields: title, body. Currently to create a receipt, I send a request…
alexg
  • 902
  • 11
  • 37
4
votes
3 answers

Integrating REST with Struts 2

How do you integrate or create a REST web-application? I saw this plugin struts rest-plugin but the documentation does not provide any running example. Are there any alternatives in using REST with Struts2 or maybe another REST plug in for Struts2?…
user962206
  • 15,637
  • 61
  • 177
  • 270
3
votes
2 answers

REST and non-RESTful URL's Together doesn't work

All my attempts to get a working example of both, pure restful configuration together with at least one non-restful URL failed. I have this page as a guide: https://cwiki.apache.org/confluence/display/WW/REST+Plugin I have one model, Receipt with a…
alexg
  • 902
  • 11
  • 37
3
votes
1 answer

Struts2-Rest: Manual HTTP 5xx doesn't return content

I'm attempting to manually return a HTTP 4xx or 5xx with a custom error message. It works perfectly for GET but returns empty content for PUT and POST. Thank you in advance to anyone who can suggest how to get the PUT and POST working! These are the…
Andrew
  • 41
  • 3
2
votes
1 answer

struts2-rest-plugin failing: "org.apache.struts2.dispatcher.Dispatcher - Could not find action or result"

I'm writing a REST server, using struts2-rest-plugin. I'm testing the REST calls with SoapUI and Postman. I'm following the sample code here: https://cwiki.apache.org/confluence/display/WW/REST+Plugin My REST calls for controller.index())and…
FoggyDay
  • 11,962
  • 4
  • 34
  • 48
2
votes
3 answers

The page is not redirecting properly by interceptor in Struts 2

That's it, I code an interceptor login, the result is access All works ok, but I think that is recalling it, the result go to access and again execute the interceptor and go access etc. I believe…
2
votes
2 answers

REST Only - default-interceptor-ref doesn't work

I'm using this as a reference to create a REST only configuration on Struts2: https://cwiki.apache.org/confluence/display/WW/REST+Plugin My current problem is with interceptors. I created a sample interceptor that should be executed before the…
alexg
  • 902
  • 11
  • 37
2
votes
1 answer

How to create custom methods using Struts2 REST plugin

My problem concerns the creation of a custom method within an action. I'm using Struts2 and REST Plugin in order to implement a RESTful WebService. My action class is the following: public class SampleController implements ModelDriven
1
vote
1 answer

I need to Customize the serializer in ember.js Adapter

My server needs json in the below format when sending a PUT request. My server is a rest api designed using struts2 rest plugin. { id: "5", empId: "5", firstName: "oki", lastName: "iko", edQual: "phd" } but the RESTAdapter serializes it…
Lonewolf
  • 113
  • 5
1
vote
1 answer

Should the namespace (and action) start with a slash?

We are developing an Struts 2 base web application. Please let me know which is correct (standard) in Strust 2 application
Alireza Fattahi
  • 42,517
  • 14
  • 123
  • 173
1
vote
1 answer

Struts2 Rest Mapper Taking Over Non Rest Json Result

Struts Version: 2.5.2 Struts Dependencies in POM org.apache.struts struts2-core ${org.strutsframework-version}
Paul Zepernick
  • 1,452
  • 1
  • 11
  • 25
1
vote
1 answer

Can I map an action method that returns Object in Struts 2

I've used Struts2 to map actions to the methods that return String. Can I use other types? What types are possible to use? I found that code using a REST plugin // Handles /orders/{id} GET requests public HttpHeaders show() { model =…
Roman C
  • 49,761
  • 33
  • 66
  • 176
1
2