Re: Stripes-users Digest, Vol 121, Issue 1

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Stripes-users Digest, Vol 121, Issue 1

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] <[hidden email]>
Sent: Thursday, April 20, 2017 1:05 PM
To: [hidden email]
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
        https://lists.sourceforge.net/lists/listinfo/stripes-users

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
To: "[hidden email]"
        <[hidden email]>
Message-ID:
        <[hidden email]>
       
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+[hidden email]>
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 <
[hidden email]>:

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

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

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



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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: Stripes-users Digest, Vol 121, Issue 1

Rick Grashel
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 <[hidden email]> wrote:

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] <[hidden email]>
Sent: Thursday, April 20, 2017 1:05 PM
To: [hidden email]
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
        https://lists.sourceforge.net/lists/listinfo/stripes-users
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
To: "[hidden email]"
        <[hidden email]>
Message-ID:
        <[hidden email]>
       
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:
        <[hidden email]>
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 <
[hidden email]>:

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