RE: Link redirect Question

"Tony Oslund" <[email protected]>
Newsgroups gmane.comp.jakarta.turbine.user
Message-ID <[email protected]>
I while back I had wanted the target web page to determine if it should
be secure or not.  It is a real pain to have to track down links within
your scripts (on the calling side).

What I did was create 2 new classes, SecureForm and RegularForm.  They
both extend VelocitySecureScreen.

If the user accesses a form that extends SecureForm, it automatically
"flips" to a secure session, regardless of whether the original link was
http or https.

Forms extended from RegularForm work in the same fashion, but instead
force http.

There may be a newer, more fancy way of doing this, but if you wish I
will post the code.  It has been in production for the last 4 years so
it is stable.




FYI the following works fine (I use it in my own code).  There was a
glitch early on if the tag was not all upper case.  Also I am not sure
if you can access setAttribute directly on the data object from within
the context of a velocity script.  In my case I create a container
session object that gets put into the session data and then I put the
necessary application specific data within the container so that there
is no chance of having the tag names collide.  I can then access (or
update... yikes) the container object from within my classes, scripts,
etc.

data.getSession().setAttribute("MYCONTAINER", containerObj); 
data.getSession().getAttribute("MYCONTAINER");


Tony

-----Original Message-----
From: Sheldon Ross [mailto:[email protected]] 
Sent: Wednesday, February 04, 2009 11:31 AM
To: [email protected]
Subject: Link redirect Question


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:","h
ttps:")"> Secure Link</a>

Which works fine in some occasions.

Is there a way to tell turbine to do this in the
setTemplate(data,"template") function ?
I would like to be able to automatically redirect to the secure side.

Any advice would be appreciated.

Thanks,
Sheldon

_________________________________________________________________
Windows Live(tm): E-mail. Chat. Share. Get more ways to connect. 
http://windowslive.com/online/hotmail?ocid=TXT_TAGLM_WL_HM_AE_Faster_022
009
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.