Re: [solved] Handling extra long set of query parameters

Splash Forums PrettyFaces Users [solved] Handling extra long set of query parameters Re: [solved] Handling extra long set of query parameters

#19993

You most certainly can do this :) And it can also be done globally or per-URL-mapping if desired.

You should take a look at the custom URL processor feature (which is new in the 3.0.x series.)

http://ocpsoft.com/docs/prettyfaces/snapshot/en-US/html/inbound_rewriting.html#inbound_rewriting.options

You’d create a rewrite rule like this:

<rewrite match="..." processor="gov.ssa.ond.url.processor.RemoveEmptyParams" redirect="301" />

Your processor would look something like this:

package gov.ssa.ond.url.processor;

public class RemoveEmptyParams implements Processor {

public String process(final RewriteRule rewrite, final String url) {
return url.replaceAll("\w+=[&]?+", "");
}
}

The pattern I’ve used in the replacement might not be exactly correct, but it will look something like that.