Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.5 RC2
-
None
-
None
Description
Hi, since the setRedirect logic was moved to the Page control...
we must validate to guarantee that the "contextPath" will not be appended to the url twice.
if you call setRedirect() two times (i know it´s strange but it´s possible), it will duplicate the contextPath...
This is how I fixed this for my app:
/**
- @see net.sf.click.Page#setRedirect(java.lang.String)
*/
public void setRedirect(String location) {
if (location != null) {
if (location.charAt(0) == '/')Unknown macro: { Context context = getContext(); String contextPath = context.getRequest().getContextPath(); if(!location.startsWith(contextPath)){ location = contextPath + location; } }}
redirect = location;
}