Hi,

IIRC, stripes-1.7.0-beta4 has in-built support for this, see
https://stripesframework.atlassian.net/wiki/spaces/STRIPES/pages/10354697/RESTful+Calculator+Example
for a simplified example. I think there are also @Post, @Get etc
annotations to override looking for post(), get(), etc. methods, but you'll
have to test how they behave (if they exist), I can't find any
documentation regarding them, and it's been a while since my last Stripes
application..

As a side note, FTR, although labelled as beta-4, we've been using for a
couple of years that version on our live environments, without issues; we
haven't used any of the async features, so can't talk about that, but the
rest support is pretty solid.


HTH,
juan pablo

On Mon, Sep 25, 2017 at 6:11 PM, DJDaveMark via Stripes-users <
stripes-users@lists.sourceforge.net> wrote:

> Sorry, sending again since the code sample seems to have been shrunk with
> the kids:
>
> I've just inherited a badly written Angular/JAX-RS application and I'd
> like to replace the JAX-RS part with Stripes. However JAX-RS seems to do a
> nice job reading JSON body requests and returning JSON responses e.g.:
>
> var data = {
>     abc: "My ABC arg",
>     xyz: "My XYZ arg",
> };
> $http.post("/somePath", data).success(function (response) {
>     // handle response
> }
>
> @POST()
> @Path("/somePath")
> @Produces(MediaType.APPLICATION_JSON)
> public Response loadSomething(SomeParams params){
>     SomeEntity entity = springBean.loadSomeEntity(params.getAbc(),
> params.getXyz());
>     return Response.ok().entity(entity).build();
> }
>
>
> Back when I was using Stripes a few years ago, I threw together a way to
> Read JSON Requests with Stripes 1.5 and I am hoping that Stripes now
> handles this.
> After a quick look, I haven't seen a way read a JSON post request into a
> Stripes ActionBean.
> Does Stripes now handle this? Is anyone else using JSON with Stripes in a
> better way that I did in the past?
>
> Thanks Dave
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Stripes-users mailing list
> Stripes-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/stripes-users
>
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to