<html> | |
<head> | |
<title>VelocityStruts - SecureLinkTool</title> | |
<meta name="author" value="Marino A. Jonsson"/> | |
<meta name="email" value="marino@apache.org" /> | |
</head> | |
<body bgcolor="#ffffff" text="#000000" link="#525D76" | |
alink="#525D76" vlink="#525D76"> | |
<table border="0" width="100%" cellspacing="4"> | |
<tr><td colspan="2"> | |
<a href="http://jakarta.apache.org/"> | |
<img src="http://jakarta.apache.org/images/jakarta-logo.gif" | |
align="left" alt="The Jakarta Project" border="0"/> | |
</a> | |
<a href="index.html"> | |
<img src="../images/velocitystruts.png" align="right" alt="< Velocity Tools - Struts >" border="0"/> | |
</a> | |
</td></tr> | |
<tr> | |
<td colspan="2"> | |
<hr noshade="" size="1"/> | |
</td> | |
</tr> | |
<tr> | |
<td width="20%" valign="top" nowrap="true"> | |
<p><strong><a href="../">Velocity Tools</a></strong></p> | |
<p> | |
<strong>VelocityStruts</strong> | |
</p> | |
<ul> | |
<li><a href="index.html">Overview</a></li> | |
<li><a href="index.html#Benefits">Benefits</a></li> | |
<li><a href="../index.html#Download">Download</a></li> | |
<li><a href="userguide.html">User Guide</a></li> | |
<li><a href="userguide.html#Installation">Installation</a></li> | |
<li><a href="../index.html#Example Applications">Examples</a></li> | |
<li><a href="../javadoc/index.html">Javadoc</a></li> | |
</ul> | |
<p> | |
<a href="StrutsTools.html"><strong>VelocityStruts Tools</strong></a> | |
</p> | |
<ul> | |
<li><a href="ActionMessagesTool.html">ActionMessagesTool</a></li> | |
<li><a href="ErrorsTool.html">ErrorsTool</a></li> | |
<li><a href="FormTool.html">FormTool</a></li> | |
<li><a href="MessageTool.html">MessageTool</a></li> | |
<li><a href="StrutsLinkTool.html">StrutsLinkTool</a></li> | |
<li><a href="SecureLinkTool.html">SecureLinkTool</a></li> | |
<li><a href="TilesTool.html">TilesTool</a></li> | |
<li><a href="ValidatorTool.html">ValidatorTool</a></li> | |
</ul> | |
<p> | |
<strong>Other Subprojects</strong> | |
</p> | |
<ul> | |
<li><a href="../generic/">GenericTools</a></li> | |
<li><a href="../view/">VelocityView</a></li> | |
</ul> | |
<p> | |
</p> | |
</td> | |
<!-- RIGHT SIDE MAIN BODY --> | |
<td colspan="1" valign="top" align="left"> | |
<table border="0" cellspacing="0" cellpadding="2" width="100%"> | |
<tr> | |
<td colspan="2" bgcolor="#525D76"> | |
<font color="#ffffff" face="arial,helvetica.sanserif"> | |
<a name="SecureLinkTool Reference Documentation"> | |
<strong>SecureLinkTool Reference Documentation</strong></a></font> | |
</td> | |
</tr> | |
<tr> | |
<td NOWRAP> </td> | |
<td> | |
<p>The SecureLinkTool extends the standard | |
<a href="../view/LinkTool.html">LinkTool</a> and has the exact same interface as | |
<a href="StrutsLinkTool.html">StrutsLinkTool</a> and the same function. It should | |
substitute the <a href="StrutsLinkTool.html">StrutsLinkTool</a> in the toolbox if | |
<a href="http://sslext.sourceforge.net">SSL Ext</a> is installed. | |
It's functionality is a subset of the functionality provided by the | |
sslext tag library for JSP.</p> | |
<p>The SSL Ext. Struts extension package makes it possible to declare Struts actions | |
secure, non-secure, or neutral in the struts config like so:</p> | |
<table width="100%" cellpadding="1" cellspacing="0" border="0"><tr><td bgcolor="#000000"> | |
<table width="100%" cellpadding="5" cellspacing="0" border="0"><tr><td bgcolor="#FFFFFF"> | |
<pre><sourcecode> | |
<action path="/someSecurePath" type="some.important.Action"> | |
<set-property property="secure" value="true"/> | |
<forward name="success" path="/somePage.vm" /> | |
</action> | |
</sourcecode></pre> | |
</td></tr></table> | |
</td></tr></table> | |
<p>If an action is declared secure the SecureLinkTool will render the relevant link | |
as https (if not already in ssl-mode). In the same way, if an action is declared | |
non-secure the SecureLinkTool will render the relevant link as http (if in ssl-mode). | |
If the action is declared as neutral (with a "secure" property of "any") then the | |
SecureLinkTool won't force a protocol change either way.<br/> If the custom | |
request processor is also used then a request will be redirected to the correct | |
protocol if an action URL is manually entered into the browser with the wrong protocol</p> | |
<p>These are the steps needed to enable SSL Ext:</p> | |
<ul> | |
<li>SSL connections need to be enabled on the webserver.</li> | |
<li>The Java Secure Socket Extension (JSSE) package needs to be in place (it's | |
integrated into the Java 2 SDK Standard Edition, v. 1.4 but optional for earlier | |
versions)</li> | |
<li>In toolbox.xml the SecureLinkTool should substitute the StrutsLinkTool</li> | |
<li>In struts-conf.xml the custom action-mapping class needs to be specified</li> | |
<li>In struts-conf.xml the custom controller class can optionally be specified | |
(if the redirect feature is wanted)</li> | |
<li>In struts-conf.xml the SecurePlugIn needs to be added</li> | |
<li>In struts-conf.xml, when using Tiles, the SecureTilesPlugin substitues both the | |
TilesPlugin and the SecurePlugIn and it also takes care of setting the correct | |
controller so there is no need to specify the custom controller.</li> | |
</ul> | |
<dl> | |
<dt><strong>See Also</strong></dt> | |
<dd> | |
<see>SSL Ext. <a href="http://sslext.sourceforge.net">project home</a></see> | |
</dd> | |
</dl> | |
<table cellpadding="0" cellspacing="0"> | |
<tr><td colspan="2"><strong>Class</strong></td></tr> | |
<tr><td> </td><td>org.apache.velocity.tools.struts.SecureLinkTool</td></tr> | |
<tr><td colspan="2"><strong>Name</strong></td></tr> | |
<tr><td> </td><td>$link (this is the recommended name of the tool in | |
the Velocity context)</td></tr> | |
<tr><td colspan="2"><strong>Toolbox Configuration Example</strong></td></tr> | |
<tr><td> </td><td><pre><tool> | |
<key>link</key> | |
<scope>request</scope> | |
<class>org.apache.velocity.tools.struts.SecureLinkTool</class> | |
</tool></pre></td></tr> | |
<tr><td colspan="2"><strong>Author(s)</strong></td></tr> | |
<tr><td> </td><td><a href="mailto:marinoj@centrum.is">Marino A. Jonsson</a><br></td></tr> | |
</table> | |
</td> | |
</tr> | |
</table> | |
</td> | |
</tr> | |
<!-- FOOTER SEPARATOR --> | |
<tr> | |
<td colspan="2"> | |
<hr noshade="" size="1"/> | |
</td> | |
</tr> | |
<!-- PAGE FOOTER --> | |
<tr><td colspan="2"> | |
<div align="center"><font color="#525D76" size="-1"><em> | |
Copyright © 1999-2003, Apache Software Foundation | |
</em></font></div> | |
</td></tr> | |
</table> | |
</body> | |
</html> |