[Httpunit-commit] CVS: httpunit/src/com/meterware/httpunit WebForm.java,1.52,1.53 WebRequestSource.j
Brought to you by:
russgold
From: Russell G. <rus...@us...> - 2002-08-05 15:20:54
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit In directory usw-pr-cvs1:/tmp/cvs-serv28820/src/com/meterware/httpunit Modified Files: WebForm.java WebRequestSource.java Log Message: Correct handling of settable form action Index: WebForm.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebForm.java,v retrieving revision 1.52 retrieving revision 1.53 diff -u -r1.52 -r1.53 --- WebForm.java 1 Aug 2002 20:23:16 -0000 1.52 +++ WebForm.java 5 Aug 2002 15:20:50 -0000 1.53 @@ -46,8 +46,8 @@ /** * Submits this form using the web client from which it was originally obtained. **/ - public void submit() throws IOException, SAXException { - submitRequest(); + public WebResponse submit() throws IOException, SAXException { + return submitRequest(); } @@ -63,8 +63,7 @@ * Returns the action defined for this form. **/ public String getAction() { - if (_action == null) _action = getDestination(); - return _action; + return getDestination(); } @@ -411,7 +410,7 @@ public class Scriptable extends ScriptableObject { public String getAction() { return WebForm.this.getAction(); } - public void setAction( String newAction ) { _action = newAction; } + public void setAction( String newAction ) { setDestination( newAction ); } public Object get( String propertyName ) { @@ -458,8 +457,6 @@ private FormControl[] _presetParameters; private ArrayList _presets; - - private String _action; private Object getObject( String name ) { Index: WebRequestSource.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebRequestSource.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- WebRequestSource.java 1 Aug 2002 14:58:59 -0000 1.9 +++ WebRequestSource.java 5 Aug 2002 15:20:51 -0000 1.10 @@ -145,6 +145,11 @@ } + protected void setDestination( String destination ) { + _destination = destination; + } + + /** * Returns the actual DOM for this request source, not a copy. **/ @@ -168,8 +173,8 @@ * Submits a request to the web client from which this request source was originally obtained. **/ final - protected void submitRequest() throws IOException, SAXException { - _baseResponse.getClient().sendRequest( getRequest() ); + protected WebResponse submitRequest() throws IOException, SAXException { + return _baseResponse.getClient().sendRequest( getRequest() ); } |