Re: PostMethodWebRequest not working

Russell Gold <[email protected]>
Newsgroups gmane.comp.web.httpunit.devel
Message-ID <[email protected]>
On Oct 29, 2007, at 8:44 AM, Lothar Krenzien wrote:

> Hi ,
>
> I'm using HTTPUnit to unit test my servlets. I wrote some testcases  
> as described in the intro (http://httpunit.sourceforge.net/doc/servletunit-intro.html 
> ). But for now I have serious trouble with POST request parameters.  
> My servlet is called correctly but a call of  
> request.getParameterMap() returns nothing. So for me it looks like  
> that the parameters I set before aren't available anymore. GET  
> requests work correctly.
>
> What I've seen is that the request object created by ServletUnit is  
> of type ServletUnitHttpRequest and has a property _request of type  
> PostMethodWebRequest which holds all parameters in a  
> parameterHolder. There are all previously set parameters are  
> available. But as described above I can't access them in the servlet.
>
> So what I'm doing wrong ?


Not clear. Look in the test directory for examples. test/com/meterware/ 
servletunit/StatelessTest.java and test/com/meterware/servletunit/ 
StatefulTest.java both contain examples of using PostMethodWebRequest.  
Compare that code with what you are doing.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.