Refactor obtaining URLs within generated code + drop relative links
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 thecontextPath
, and therefore there are multiple places wherePageServlet.getAbsolutePath
andThreadLocalServlet.getContextPath
are concatenated.The idea is to leave
getContextPath
as is, but changegetAbsolutePath
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
Submitted by Elmer van Chastelet on 2 October 2013 at 15:47ThreadLocalServlet.getContextPath
to become absolute urls usingPageServlet.getAbsolutePath
Issue Log
Fixed in r5799
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.
Fixed in r5800
And reopen again… newly deployed yellowgrass exposes some issues with links in mails.
Log in to post comments