Skip to content

Commit f153adb

Browse files
committed
Issue 125
1 parent 52135b9 commit f153adb

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

‎core/src/main/java/com/ocpsoft/pretty/faces/application/PrettyRedirector.java‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ public boolean redirect(final FacesContext context, final String action)
6262
String target = contextPath + url.encode() + query.toQueryString();
6363
log.trace("Refreshing requested page [" + url + "]");
6464
String redirectUrl = externalContext.encodeActionURL(target);
65+
redirectUrl = ((HttpServletResponse) externalContext.getResponse()).encodeRedirectURL(redirectUrl);
6566
externalContext.redirect(redirectUrl);
6667
return true;
6768
}
@@ -74,6 +75,7 @@ else if (isPrettyNavigationCase(prettyContext, action))
7475
+ builder.buildQueryString(mapping);
7576
log.trace("Redirecting to mappingId [" + mapping.getId() + "], [" + url + "]");
7677
String redirectUrl = externalContext.encodeActionURL(url);
78+
redirectUrl = ((HttpServletResponse) externalContext.getResponse()).encodeRedirectURL(redirectUrl);
7779
externalContext.redirect(redirectUrl);
7880
}
7981
else
@@ -103,7 +105,7 @@ public void send404(final FacesContext facesContext)
103105
}
104106
}
105107

106-
private boolean isPrettyNavigationCase(PrettyContext prettyContext, final String action)
108+
private boolean isPrettyNavigationCase(final PrettyContext prettyContext, final String action)
107109
{
108110
PrettyConfig config = prettyContext.getConfig();
109111
return (action != null) && config.isMappingId(action) && action.trim().startsWith(PrettyContext.PRETTY_PREFIX);

‎impl-jsf2/src/main/java/com/ocpsoft/pretty/faces/application/PrettyRedirector.java‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ public boolean redirect(final FacesContext context, final String action)
6363
String target = contextPath + url.encode().toURL() + query.toQueryString();
6464
log.trace("Refreshing requested page [" + url + "]");
6565
String redirectUrl = externalContext.encodeRedirectURL(target, null);
66+
redirectUrl = ((HttpServletResponse) externalContext.getResponse()).encodeRedirectURL(redirectUrl);
6667
externalContext.redirect(redirectUrl);
6768
return true;
6869
}
@@ -75,6 +76,7 @@ else if (isPrettyNavigationCase(prettyContext, action))
7576
+ builder.buildQueryString(mapping).toString();
7677
log.trace("Redirecting to mappingId [" + mapping.getId() + "], [" + url + "]");
7778
String redirectUrl = externalContext.encodeRedirectURL(url, null);
79+
redirectUrl = ((HttpServletResponse) externalContext.getResponse()).encodeRedirectURL(redirectUrl);
7880
externalContext.redirect(redirectUrl);
7981
}
8082
else
@@ -104,7 +106,7 @@ public void send404(final FacesContext facesContext)
104106
}
105107
}
106108

107-
private boolean isPrettyNavigationCase(PrettyContext prettyContext, final String action)
109+
private boolean isPrettyNavigationCase(final PrettyContext prettyContext, final String action)
108110
{
109111
PrettyConfig config = prettyContext.getConfig();
110112
return (action != null) && config.isMappingId(action) && action.trim().startsWith(PrettyContext.PRETTY_PREFIX);

0 commit comments

Comments
 (0)