according to both the code and javadocs, that's what it is supposed to do when you pass a relative url into that method. there isn't really a method in Tools 1.4's LinkTool that does what you want. all setAbsolute can do in 1.4 is:
$link.absolute('/foo') -> http://host/context/foo $link.absolute('foo') -> http://host/context/foo $link.absolute('http://althost/foo') -> http://althost/foo but in Tools 2, you get: $link.absolute('/foo') -> http://host/foo $link.absolute('foo') -> http://host/context/foo $link.absolute('http://althost/foo') -> http://althost/foo On Tue, Sep 7, 2010 at 7:26 AM, Christopher Schultz <ch...@christopherschultz.net> wrote: > All, > > I'm having a problem using LinkTool (StrutsLinkTool, actually) in > Velocity Tools 1.4. What I want is a fully-qualified URL without the > current webapp's context path in the URL. Something like this: > > http://host/path/to/resource > > What I'm getting from LinkTool.setAbsolute('/foo/bar') is this: > > http://host/context/foo/bar > > Do I misunderstand the javadocs? I would expect that my call would yield > a URL without the context path. > > I'm passing a literal string to LinkTool.setAbsolute, so I don't have a > variable whose value I'm wrong about or anything like that. > > Any ideas? > > Thanks, > -chris > > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@velocity.apache.org For additional commands, e-mail: user-h...@velocity.apache.org