Details
Description
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 :-
ForwardConfig
ActionForward
StrutsConfig.dtd
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
enhancement.
Hope this helps
Jonathan Hudson