Re: Raw Body With ActionBean

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: Raw Body With ActionBean

DaveMark
Hi all,

Sorry for the late response. I used Stripes 1.5 to communicate with an angular 1.5 frontend which posts with a json body by wrapping the HTTPServletRequest.

I created a wiki page with the code

Cheers,
DaveMark
.


On Thursday, 4 May 2017, 22:26, "[hidden email]" <[hidden email]> wrote:


Send Stripes-users mailing list submissions to

To subscribe or unsubscribe via the World Wide Web, visit
or, via email, send a message with subject or body 'help' to

You can reach the person managing the list at

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Stripes-users digest..."


Today's Topics:

  1. Re: Stripes-users Digest, Vol 121, Issue 1 (Rick Grashel)


----------------------------------------------------------------------

Message: 1
Date: Thu, 4 May 2017 13:51:51 -0500
From: Rick Grashel <[hidden email]>
Subject: Re: [Stripes-users] Stripes-users Digest, Vol 121, Issue 1
To: Stripes Users List <[hidden email]>
Message-ID:
    <CADoNxePujfj+[hidden email]>
Content-Type: text/plain; charset="utf-8"

Hi Jon,

You cannot handle this with a currently released version of Stripes --
although it could be done with Stripes in the master branch.  The only way
with a stable release of Stripes is to do something along the lines of the
example that I sent previously.  You will need to have your action bean
implement a @Before(BindingAndValidation) method.  Have it take the request
body, parse the JSON and then set fields on your action bean.  Then, the
event handler method can function as usual.

Thanks.

-- Rick

On Wed, May 3, 2017 at 4:02 PM, Heather and Jon Turgeon <

> Thanks guys, for my first question I ended up using FreeMarker which so
> far is working great.
>
>
> For my second question about getting a JSON Payload from a Post from a
> Relay Webhook from Sparkpost . I see several examples of how to do this
> with a servlet but I was hoping that Stripes could handle this. Anyone have
> an idea as to if this is possible and if not any good ideas as to how to
> implement? Thanks for any help.
>
>
> Jon
>
>
> ------------------------------
> *From:* [hidden email] <
> *Sent:* Thursday, April 20, 2017 1:05 PM
> *Subject:* Stripes-users Digest, Vol 121, Issue 1
>
> Send Stripes-users mailing list submissions to
>        [hidden email]
>
> To subscribe or unsubscribe via the World Wide Web, visit
> Stripes-users Info Page - SourceForge
> lists.sourceforge.net
> Mailing list intended for all discussions related to using Stripes to
> build applications. This is the appropriate place to ask for help and to
> report problems that ...
>
> or, via email, send a message with subject or body 'help' to
>        [hidden email]
>
> You can reach the person managing the list at
>        [hidden email]
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Stripes-users digest..."
>
>
> Today's Topics:
>
>    1. Getting the results of JSP within an Action
>      (Heather and Jon Turgeon)
>    2. Re: Getting the results of JSP within an Action (Nestor Hernandez)
>    3. Re: Getting the results of JSP within an Action (Rick Grashel)
>    4. Raw Body With ActionBean (Heather and Jon Turgeon)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 7 Apr 2017 06:58:15 +0000
> From: Heather and Jon Turgeon <[hidden email]>
> Subject: [Stripes-users] Getting the results of JSP within an Action
>        <[hidden email]>
> Message-ID:
>        <[hidden email]
> namprd14.prod.outlook.com>
>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi all, within my Stripes based website I do a few of thing. One of them
> is to create emails to send out to users. I am using HTML emails with the
> bodies written as strings (a bit of work and very messy). What I would like
> to do is use an Action to get the data from the db, then do a Resolution to
> a JSP, but get the results of the resolution within the Action in the form
> of a String. This way I can use JSP as an email template, grab the result
> and use this as the body of an email. Hopefully this is possible and thanks
> for any help.
>
>
> Jon
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
>
> ------------------------------
>
> Message: 2
> Date: Fri, 7 Apr 2017 07:14:27 -0500
> From: Nestor Hernandez <[hidden email]>
> Subject: Re: [Stripes-users] Getting the results of JSP within an
>        Action
> To: Stripes Users List <[hidden email]>
> Message-ID:
>        <CAMsyVL+YL8WxB_Jq_67Jozm+age3bHe5hB8HrjvTEyfN_2+13Q@
> mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Uhh, it's very strange what you do because JSP are not intended for that.
> Why not use a template library like Velocity, Freemaker or Mustache?
>
> 2017-04-07 1:58 GMT-05:00 Heather and Jon Turgeon <
>
> > Hi all, within my Stripes based website I do a few of thing. One of them
> > is to create emails to send out to users. I am using HTML emails with the
> > bodies written as strings (a bit of work and very messy). What I would
> like
> > to do is use an Action to get the data from the db, then do a Resolution
> to
> > a JSP, but get the results of the resolution within the Action in the
> form
> > of a String. This way I can use JSP as an email template, grab the result
> > and use this as the body of an email. Hopefully this is possible and
> thanks
> > for any help.
> >
> >
> > Jon
> >
> >
> >
> > ------------------------------------------------------------
> > ------------------
> > 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 Info Page - SourceForge
> lists.sourceforge.net
> Mailing list intended for all discussions related to using Stripes to
> build applications. This is the appropriate place to ask for help and to
> report problems that ...
>
> >
> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
>
> ------------------------------
>
> Message: 3
> Date: Fri, 7 Apr 2017 07:24:34 -0500
> From: Rick Grashel <[hidden email]>
> Subject: Re: [Stripes-users] Getting the results of JSP within an
>        Action
> To: Stripes Users List <[hidden email]>
> Message-ID:
>        <CADoNxeM4HsHUVs-bSbAUxpom-8ONZwtB_zWo6toPNDvon_zsrw@
> mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Agree, definitely use Velocity for this.  This is exactly the kind of use
> case that Velocity wad intended foe.
>
> -- Rick
>
> On Apr 7, 2017 7:15 AM, "Nestor Hernandez" <[hidden email]> wrote:
>
> > Uhh, it's very strange what you do because JSP are not intended for that.
> > Why not use a template library like Velocity, Freemaker or Mustache?
> >
> > 2017-04-07 1:58 GMT-05:00 Heather and Jon Turgeon <
> >
> >> Hi all, within my Stripes based website I do a few of thing. One of them
> >> is to create emails to send out to users. I am using HTML emails with
> the
> >> bodies written as strings (a bit of work and very messy). What I would
> like
> >> to do is use an Action to get the data from the db, then do a
> Resolution to
> >> a JSP, but get the results of the resolution within the Action in the
> form
> >> of a String. This way I can use JSP as an email template, grab the
> result
> >> and use this as the body of an email. Hopefully this is possible and
> thanks
> >> for any help.
> >>
> >>
> >> Jon
> >>
> >>
> >>
> >> ------------------------------------------------------------
> >> ------------------
> >> 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 Info Page - SourceForge
> lists.sourceforge.net
> Mailing list intended for all discussions related to using Stripes to
> build applications. This is the appropriate place to ask for help and to
> report problems that ...
>
> >>
> >>
> >
> > ------------------------------------------------------------
> > ------------------
> > 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 Info Page - SourceForge
> lists.sourceforge.net
> Mailing list intended for all discussions related to using Stripes to
> build applications. This is the appropriate place to ask for help and to
> report problems that ...
>
> >
> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
>
> ------------------------------
>
> Message: 4
> Date: Thu, 20 Apr 2017 17:04:53 +0000
> From: Heather and Jon Turgeon <[hidden email]>
> Subject: [Stripes-users] Raw Body With ActionBean
>        <[hidden email]>
> Message-ID:
>        <[hidden email]
> namprd14.prod.outlook.com>
>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi all, I am trying to use SparkPost Relay Webhooks to accept emails, then
> forward on the content to a ActionBean for processing. I have the
> forwarding worked out but SparkPost is posting a "raw body" JSON object to
> the ActionBean. I have never used an ActionBean like this, I usually expect
> parameters with values. Anyway, is there a way for a Stripes ActionBean to
> accept this? Thanks for any help.
>
>
> Jon
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
>
> ------------------------------
>
> ------------------------------------------------------------
> ------------------
> 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 Info Page - SourceForge
> lists.sourceforge.net
> Mailing list intended for all discussions related to using Stripes to
> build applications. This is the appropriate place to ask for help and to
> report problems that ...
>
>
>
> End of Stripes-users Digest, Vol 121, Issue 1
> *********************************************
>
> ------------------------------------------------------------
> ------------------
> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...

------------------------------

------------------------------------------------------------------------------
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


End of Stripes-users Digest, Vol 122, Issue 2
*********************************************



------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users