When Apache uses ErrorDocument to handle a URL it stores the requested url and its query string into two separate headers, "redirect_url" and "redirect_query_string". Since the query string is not part of the URI, query parameters (form values) are not parsed and not accessible from the application (in the traditional way).
I'm currently handling this by appending the query string to the URL in dispatchRequest, then creating a new request with the new uri and dispatching it:
-----------------------------------------------------------
@Override
public WOResponse dispatchRequest( WORequest r ) {
String queryString = r.headerForKey( "redirect_query_string" );
if( queryString != null ) {
String uri = r.uri() + "?" + queryString;
r = new ERXRequest( r.method(), uri, r.httpVersion(), r.headers(), r.content(), r.userInfo() );
}
return super.dispatchRequest( r );
}
-----------------------------------------------------------
This works, but I don't like it since I'm (1) Creating two request objects for every request and (2) More importantly, I don't want this logic in dispatchRequest since this functionality is part of a non-intrusive framework (ie. no classes in the application should have to inherit from special classes in the framework).
So: Does anyone have any great ideas on how to get those damned query parameters into my form values dictionary, without hacking around in the Application class?