While working on a fix for https://yellowgrass.org/issue/WebDSL/750, the code for obtaining the absolute url-paths is unclear and feels hacky. Moreover PageServlet.getAbsolutePath returns the root URL without the contextPath, and therefore there are multiple places where PageServlet.getAbsolutePath and ThreadLocalServlet.getContextPath are concatenated.

The idea is to leave getContextPath as is, but change getAbsolutePath to include the contextPath.

Example url1: http://www.webdsl.org/NonRootApp/pageRequested
Example url2: http://www.webdsl.org/pageRequested

old situation:
PageServlet.getAbsolutePath :
url1: http://www.webdsl.org/
url2: http://www.webdsl.org
ThreadLocalServlet.getContextPath:
url1: NonRootApp
url2: (empty string)

refactored situation:
PageServlet.getAbsolutePath :
url1: http://www.webdsl.org/NonRootApp
url2: http://www.webdsl.org
ThreadLocalServlet.getContextPath:
url1: NonRootApp
url2: (empty string)

After this change we should replace instances where relative urls are construced using ThreadLocalServlet.getContextPath to become absolute urls using PageServlet.getAbsolutePath

Submitted by Elmer van Chastelet on 2 October 2013 at 15:47

On 2 October 2013 at 17:36 Elmer van Chastelet commented:

Fixed in r5799


On 2 October 2013 at 17:36 Elmer van Chastelet closed this issue.

On 3 October 2013 at 10:13 Elmer van Chastelet reopened this issue.

On 3 October 2013 at 10:17 Elmer van Chastelet commented:

Introduced regression, got some double slashes between root url and context path, causing web-tests to fail
ERROR Error: server received POST request but was unable to dispatch to a proper action

edit: probably only in test context.


On 4 October 2013 at 15:24 Elmer van Chastelet commented:

Fixed in r5800


On 4 October 2013 at 15:24 Elmer van Chastelet closed this issue.

On 9 October 2013 at 15:58 Elmer van Chastelet commented:

And reopen again… newly deployed yellowgrass exposes some issues with links in mails.


On 9 October 2013 at 15:58 Elmer van Chastelet reopened this issue.

Log in to post comments