On Sat, 12 May 2001, Ted Husted wrote:
> Craig,
>
> Speaking of schemes, any advice on the easiest way to flip between http:
> and https: -- the context being able to offer the option of logging in
> securely under https:, and then returning to http: afterwards.
>
You can calculate an absolute URL for this web app, based on things like
request.getServerName(), request.getContextPath(), and so on. So, one way
to do this would be to have an action that calculated the new absolute
URL, wrapped it in a new ActionForward with the "redirect" property set,
and return that to the controller servlet. It looks pretty much like what
you quoted in the mail message.
NOTE: Because the controller servlet calls encodeRedirectURL() for you on
redirections, sessions should survive across this transfer whether or not
you are using cookies.
If you're running on ports other than the default (80 and 443), you will
probably also want a configuration parameter to define what the
corresponding SSL and non-SSL ports are.
> Yahoo! Auctions does this, and I'm trying to do that same at
>
> < http://data.wxxi.org/wxxi-gavel/ >
>
> See also
>
> <
> http://www.mail-archive.com/struts-user%40jakarta.apache.org/msg07841.html
> >
>
> -Ted.
>
Craig