Thanks, 
   That works out well.

So at the beginning of my Default.vm I have:

#if($secure && !$data.Request.Secure)
    #set($redirect = 
$link.setPage($data.getTemplateInfo().getScreenTemplate()).setAction($data.getAction()).setSecure().toString())
    $data.setRedirectURI($redirect)
    $data.setStatusCode(302)
#end

And in any page I want to make secure I just put

#set($secure = true)

at the beginning.

Works like charm!

> Date: Sun, 8 Feb 2009 15:40:28 +0100
> From: [email protected]
> To: [email protected]
> Subject: Re: Link redirect Question
> 
> Sheldon Ross wrote:
> > Another question I have:
> > Is there an easier way to redirect to secure server.
> > 
> > I've figured out a way to do it.
> > Basically on a screen I'll have something like:
> > 
> > <a 
> > href="$link.setPage('mydir,mytemplate').toString().replaceAll("http:","https:")">
> >  Secure Link</a>
> 
> I'd suggest to extend the TemplateLink pull-tool to allow to call
> setSecure() on the underlying TemplateLink object. This would allow
> something in the line of
> 
> #if(!$data.Secure)
> $data.Response.setRedirectURI("$link.setPage('mydir,mytemplate').setSecure(true).getAbsoluteLink()");
> $data.setStatusCode(302)
> #end
> 
> 
> Bye, Thomas.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 

_________________________________________________________________
See how Windows connects the people, information, and fun that are part of your 
life.
http://clk.atdmt.com/MRT/go/msnnkwxp1020093175mrt/direct/01/

Reply via email to