Uploaded image for project: 'Struts 1'
  1. Struts 1
  2. STR-2616

SSL Switching

Agile BoardAttach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments


    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.3.0
    • Fix Version/s: Future
    • Component/s: Core
    • Labels:
    • Environment:
      Operating System: other
      Platform: Other
    • Bugzilla Id:


      My enhancement relates to the SSL switching within Struts. Enhancement
      requires only small changes to the RequestProcessor which I have already made
      and tested .. actually it's how I currently manage SSL switching in all my
      Struts projects. I made the change originally to 1.2 which is the version I am
      currently using however I have examined 1.3 and the change can be applied
      there also without any rework.

      From a users perspective the change is as simple as setting an attribute
      secure="true" on the <forward> element. When set the RequestProcessor
      automatically manages the switch. If the next forward is not defined as secure
      then the next forward (redirect) switches SSL mode off. All navigations from
      SSL -> SSL are dealt with in the normal way, it's only when switching modes
      that the additional code forces the redirect. Simple change really but answers
      a problem that no doubt many users have with Struts.

      Description of change (Classes impacted) :-
      Add new attribute "secure" of type "boolean" to the form part of the action
      mapping this is implemented in :-


      Add an additional parameter to the ActionServlet config of sslPort. This will
      be configured in the web.xml file.

      Remainder of change is a change to the RequestProcessor in the init method to
      nitialise the sslPort using for ssl switching. The other change is in the same
      class in processForwardConfig this is where the switching to and from SSL mode
      takes place.

      I have been using this solution for some time in my projects and it works
      well, is simple to implement and understand. I have the code changes (small)
      that are required to the above classes however I haven't attached to this

      Hope this helps

      Jonathan Hudson




            • Assignee:
              jon_efun@yahoo.co.uk Jonathan Hudson


              • Created:

                Issue deployment