Webform.newUnvalidatedRequest question
Stuart Maclean <[email protected]>
| Newsgroups | gmane.comp.web.httpunit.devel |
|---|---|
| Message-ID | <[email protected]> |
In order to mimic a javascript-driven change to a hidden form parameter,
I am using WebForm.newUnvalidatedRequest(). My problem is that the form
action string includes a query string, which the server will see as
parameters (the form is a POST). The query string does not get passed
over to the new WebRequest, I need to do it by hand:
private WebRequest newUnvalidatedRequest( WebForm f ) {
WebRequest result = f.newUnvalidatedRequest();
String[] sa = f.getParameterNames();
for( int i = 0; i < sa.length; i++ ) {
String key = sa[i];
String[] values = f.getParameterValues( key );
result.setParameter( key, values );
}
return result;
}
Is the observed behaviour of Webform.newUnvalidatedRequest a bug or
feature? If the web request is to be mimicing the form, then should its
submission not mimic the submission of the form? The server would see
different parameters lists for the two submissions, unless I append the
parameters to the WebRequest as above??
Any help appreciated.
Stuart Maclean
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642