jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "david.off@voila.fr" <david....@voila.fr>
Subject RE: Problem with sending multiple parameters with POST method
Date Thu, 08 Aug 2002 17:45:50 GMT

Yes I had a similar problem with the latest version of Cactus on Weblogic 5.1 / sp12

It seems as if the POST and GET parameters get  confused.  If you don't specify WebRequest.POST_METHOD
then the parameter gets posted (I think this is correct behaviour).

If you put the following into your beginXXX method:
        while (e.hasMoreElements()) {
			System.out.println(">>> " + (String) e.nextElement());
		}

		e = request.getParameterNamesGet();
		while (e.hasMoreElements()) {
			System.out.println("<<< " + (String) e.nextElement());
		}

You will see that the 'Post' data is recovered with the Get() method and vice-versa (I think...).
 I didn't look into this any further at present as I am only posting data to my Servlets and
simply ommiting the WebRequest.POST_METHOD parameter gives me the behaviour I want.  I suggest
you download the source and take a look, it is probably something quite straightforward.

regards,

David


> Hi,
> 
> When I set few parameters with method as POST (in beginXXX method), only 
> one of them retains the value (in testXXX method). However it does not 
> occur if I sending the params as GET. I am using Weblogic 6.1sp2. I could 
> not find an example in the samples where more than one param are sent with 
> method as POST. I tried setting the content type too. The following is my 
> code and the output on the container:
> CODE:
>     public void beginPostMethod(WebRequest theRequest)
>     {
>       theRequest.addParameter("page", "LoginPage");
>       theRequest.addParameter("EVENT", "login");
>       theRequest.addParameter("firstpage", "HomePage", 
> WebRequest.POST_METHOD);
>       theRequest.addParameter("CheckEntry", "valid", 
> WebRequest.POST_METHOD);
>       theRequest.addParameter("USER", "dba22", WebRequest.POST_METHOD);
>       theRequest.addParameter("dblabel", "oradb01", 
> WebRequest.POST_METHOD);
>       theRequest.addParameter("SEQNO", "1", WebRequest.POST_METHOD);
>     }
> 
>     public void testPostMethod() throws ServletException, IOException
>     {
> 
>       PageServlet servlet = new PageServlet();
>       try {
>         servlet.init(config);
>       System.out.println(request.getParameter("page"));
>       System.out.println(request.getParameter("EVENT"));
>       System.out.println(request.getParameter("firstpage"));
>       System.out.println(request.getParameter("CheckEntry"));
>       System.out.println(request.getParameter("USER"));
>       System.out.println(request.getParameter("dblabel"));
>       System.out.println(request.getParameter("SEQNO"));
> 
>       servlet.doPost(request,response);
>      }
> 
> OUTPUT:
> LoginPage
> login
> null
> null
> null
> oradb01
> null
> 
> Thanks,
> Siva
> 
------------------------------------------

Faites un voeu et puis Voila ! www.voila.fr 


--
To unsubscribe, e-mail:   <mailto:cactus-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:cactus-user-help@jakarta.apache.org>


Mime
View raw message