You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by bu...@apache.org on 2004/11/07 16:17:26 UTC
DO NOT REPLY [Bug 32104] New: -
Link Tools do not work properly with ROOT context
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=32104>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=32104
Link Tools do not work properly with ROOT context
Summary: Link Tools do not work properly with ROOT context
Product: Velocity
Version: 1.4
Platform: All
URL: http://jakarta.apache.org/velocity/tools/struts/SecureLi
nkTool.html
OS/Version: Other
Status: NEW
Severity: Normal
Priority: Other
Component: Tools
AssignedTo: velocity-dev@jakarta.apache.org
ReportedBy: laurent.dauvilaire@laposte.net
When you install a webapp as ROOT, then the context-path is "/" and
not "/myapp" as for standard webapps.
The link tools (LinkTool, StrutsLinkTool and SecureLinkTool) return bad
references when the webapp is installed as ROOT.
Example:
$link.setRelative("templates/index.vm")
returns "//templates/index.vm"
when it sould return "/templates/index.vm"
The Code (LinkTool.java line 320)
"request.getContextPath() + '/' + uri"
is correct only when the Context Path is something like "/myapp".
When the Context Path is "/" another '/" should not be added before the URI.
Regards
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org