| |
|
| java.lang.Object org.apache.velocity.tools.view.tools.LinkTool org.apache.velocity.tools.struts.SecureLinkTool
SecureLinkTool | public class SecureLinkTool extends LinkTool (Code) | | Tool to be able to use Struts SSL Extensions with Velocity.
It has the same interface as StrutsLinkTool and can function as a
substitute if Struts 1.x and SSL Ext are installed.
Usage:
Template example:
<!-- Use just like a regular StrutsLinkTool -->
$link.action.nameOfAction
$link.action.nameOfForward
If the action or forward is marked as secure, or not,
in your struts-config then the link will be rendered
with https or http accordingly.
Toolbox configuration:
<tool>
<key>link</key>
<scope>request</scope>
<class>org.apache.velocity.tools.struts.SecureLinkTool</class>
</tool>
since: VelocityTools 1.1 author: Marino A. Jonsson version: $Revision: 487322 $ $Date: 2006-12-14 11:49:10 -0800 (Thu, 14 Dec 2006) $ |
computeURL | public String computeURL(HttpServletRequest request, ServletContext app, String link)(Code) | | Compute a hyperlink URL based on the specified action link.
The returned URL will have already been passed to
response.encodeURL() for adding a session identifier.
Parameters: request - the current request. Parameters: app - the current ServletContext. Parameters: link - the action that is to be converted to a hyperlink URL the computed hyperlink URL |
setAction | public SecureLinkTool setAction(String action)(Code) | | Returns a copy of the link with the given action name
converted into a server-relative URI reference. This method
does not check if the specified action really is defined.
This method will overwrite any previous URI reference settings
but will copy the query string.
Parameters: action - an action path as defined in struts-config.xml a new instance of StrutsLinkTool |
setForward | public SecureLinkTool setForward(String forward)(Code) | | Returns a copy of the link with the given global forward name
converted into a server-relative URI reference. If the parameter
does not map to an existing global forward name, null
is returned. This method will overwrite any previous URI reference
settings but will copy the query string.
Parameters: forward - a global forward name as defined in struts-config.xml a new instance of StrutsLinkTool |
toEncoded | public String toEncoded(String url, String sessionId)(Code) | | Return the specified URL with the specified session identifier
suitably encoded.
Parameters: url - URL to be encoded with the session id Parameters: sessionId - Session id to be included in the encoded URL the specified URL with the specified session identifier suitably encoded |
|
|
|