Re: ADF, PrettyFaces and a persistent query param

Splash Forums PrettyFaces Users ADF, PrettyFaces and a persistent query param Re: ADF, PrettyFaces and a persistent query param

#21584

clemmonsm
Participant

We are on the same page here. My outbound links are being appended with the correct ADF param value and have been working fine when clicked on the page. For other ADF users, here is the config and code I am using to make this happen:

<rewrite match=".*(^/$|/about-drees/|/finance/|/build-on-your-lot/|/new-homes/|/request-info/|/career/)+.*" processor="siteUtils.PrettyFacesAdfProcessor" inbound="false" redirect="301" /> <!-- only process these outbound matches -->
<rewrite processor="siteUtils.PrettyFacesAdfProcessor" outbound="false" redirect="301" />

public class PrettyFacesAdfProcessor implements Processor {

public String processInbound(final HttpServletRequest request, final HttpServletResponse response, final RewriteRule rewrite, final String url) {

return url;
}

public String processOutbound(final HttpServletRequest request, final HttpServletResponse response, final RewriteRule rewrite, final String url) {

if (request.getParameterValues("_adf.ctrl-state") != null && !url.contains("_adf.ctrl-state")) {
// param exists and is not assigned to url, so append _adf.ctrl-state key/value to query string
String newUrl = url + "?_adf.ctrl-state=" + request.getParameterValues("_adf.ctrl-state")[0];
return newUrl;
}
return url;
}
}

I am still not certain why the ADF param does not persist between requests without the above code – if I figure it out, I will be sure to post the insight here for future reference. Thanks again for all of the help!