* This code will automatically submit form parameters. If it is a post,
* then we ignore the parameters request and use the webforward target.
*/
method = new ProxiedHttpMethod(webForward.getFormType(),
target.getFile(),
webForward.getFormType().equals(WebForwardTypes.FORM_SUBMIT_POST) ? new MultiMap() : new MultiMap(request.getParameters()),
launchSession.getSession(),
webForward.getFormType().equals(WebForwardTypes.FORM_SUBMIT_POST));
if (webForward.getCharset() != null
&& !webForward.getCharset().equals("")
&& !webForward.getCharset().equals(WebForwardTypes.DEFAULT_ENCODING))
method.setCharsetEncoding(webForward.getCharset());
StringTokenizer tokens = new StringTokenizer(webForward.getFormParameters(), "\n");
int idx;
String param;
while (tokens.hasMoreTokens()) {
param = v.replace(tokens.nextToken().trim());
idx = param.indexOf('=');
if (idx > -1) {
method.addParameter(param.substring(0, idx), param.substring(idx + 1));
} else
method.addParameter(param, "");
}
launchSession.setAttribute(LAUNCH_ATTR_AUTH_POSTED, Boolean.TRUE);
processRequestHeaders(request, method);
// Do not send through any cookies on the authentication request
method.getProxiedRequest().removeFields(HttpConstants.HDR_COOKIE);
client.removeAllCookies();
} else {
method = new ProxiedHttpMethod(request.getMethod(),
request.getURIEncoded(),
new MultiMap(request.getParameters()),
launchSession.getSession(),
request.getContentType() != null && request.getContentType()
.toLowerCase()
.startsWith("application/x-www-form-urlencoded"));
if (webForward.getCharset() != null