Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-3232

New Cookie Interceptor

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 2.1.6
    • 7.0.0
    • Core Interceptors
    • None

    Description

      Hello, I've developed for my current project a simple Cookie Interceptor. It's like the one in the distribution but different,

      It works by annotating in the action with a @Cookie(name="cookieName",timeToLive=100,path="xxx") a String property.

      The Interceptor (Which is also a PreResultListener) Scans the action. if it finds a @Cookie annotation it injects the cookie value into the action's property. When the action is executed, the interceptor's beforeResultMethod scans the action again and the values from properties annotated with @Cookie are saved in the response's cookies.

      This is the basic idea, than using just the getters and setters in the action you can retrieve and set a cookie..

      I would love to share this simple interceptor, i would love to see a little of my code added to your project ... what can i do for you to see the code and if it's something you like, submit it... thanks..

      Attachments

        1. struts-cookie-interceptor.tar.gz
          26 kB
          carlo scarioni

        Issue Links

          Activity

            People

              maurizio.cucchiara Maurizio Cucchiara
              carlo81 carlo scarioni
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: