On 9/24/07, Daniel Frisk <[EMAIL PROTECTED]> wrote:
> I'm trying to add a check to the constructor on one of our pages (a
> credit card processing page) which should:
> 1. If protocol is HTTPS; continue as usual
> 2. Else redirect so that HTTPS is used to access the same page
>
> I saw the sample in the wiki with the annotations that intercepted
> the request processing and etc but it seemed overly complicated for
> this tiny check, any ideas for a minimal implementation which could
> serve this purpose?

The basic idea I think is here:

StringBuffer url = new StringBuffer("https://"; +
httpServletRequest.getServerName());
url.append(":" + MyApplication.get().getSslPort());
String q = RequestCycle.get().urlFor(requestTarget).toString();
url.append(q);
webResponse.redirect(url.toString());

That pattern outlined in the WIKI article is a way to make it easy to
build an application where you have to switch often.

I haven't played around with these things, but if you want to do
something relatively simple, and you don't want to have to configure
the render strategy particularly for this, I think you should be able
to just redirect e.g. using a refresh header or using the redirect
page to a bookmarkable page. Would that help?

Eelco

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to