Return-Path: Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 58722 invoked from network); 14 Feb 2001 03:42:18 -0000 Received: from fallback-mx1.registeredsite.com (64.224.9.15) by h31.sny.collab.net with SMTP; 14 Feb 2001 03:42:18 -0000 Received: from mail2.registeredsite.com (mail2.registeredsite.com [64.224.9.11]) by fallback-mx1.registeredsite.com (8.11.1/8.11.1) with ESMTP id f1E3gOf22850 for ; Tue, 13 Feb 2001 22:42:24 -0500 Received: from mail.fitzpatrick.cc ([216.247.102.238]) by mail2.registeredsite.com (8.11.1/8.11.1) with ESMTP id f1E3gNV13398 for ; Tue, 13 Feb 2001 22:42:23 -0500 Received: from cartman [24.13.242.72] by mail.fitzpatrick.cc (SMTPD32-6.00) id AE98715F011C; Tue, 13 Feb 2001 22:42:16 -0500 From: "CPC Livelink Admin" To: Subject: RE: HttpUtil Date: Tue, 13 Feb 2001 22:42:14 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="windows-1257" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) In-Reply-To: <006e01c09698$e3380a70$67500a0a@junxu.silkroute.com> Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N Well, I just changed the form from "get" to "post" in the sample I posted (which is still below) and I got exactly the same results. I don't know what your problem is - are you doing anything special beyond what's in the example below. Regards, Paul -----Original Message----- From: sun [mailto:junxu@silkroute.com] Sent: Wednesday, February 14, 2001 10:15 AM To: tomcat-user@jakarta.apache.org Subject: Re: HttpUtil yes, for get method, it is working, but I have to use post method. rgds sun -----Original Message----- From: CPC Livelink Admin To: tomcat-user@jakarta.apache.org Date: Tuesday, February 13, 2001 9:15 AM Subject: RE: HttpUtil > >It works for me as well. The only caveat is that with text boxes (which I >thought you said you were not using) the browser sends an empty string for >some of the boxes. > >Here is some sample JSP code : > > > > ><% > String []vals = request.getParameterValues("foo"); > if (vals != null) > { > for (int i = 0; i < vals.length; i++) > { > %> >
  • [<%= vals[i] %>]
  • > <% > } > } >%> > >

    > >
    > Foo > Foo > Foo > Foo > Foo > Foo > > >
    > > > > >-----Original Message----- >From: Randy Layman [mailto:randy.layman@aswethink.com] >Sent: Tuesday, February 13, 2001 7:35 AM >To: tomcat-user@jakarta.apache.org >Subject: RE: HttpUtil > > > > Then your HTML or web browser is not correct. I use this method for >exactly what you are trying to do and it works just fine. > > Randy > >-----Original Message----- >From: sun [mailto:junxu@silkroute.com] >Sent: Tuesday, February 13, 2001 1:58 PM >To: tomcat-user@jakarta.apache.org >Subject: Re: HttpUtil > > >I tried, in array, it contains 5 values, 1,2,3,4,5, cann't get exactly which >I selected. > >-----Original Message----- >From: CPC Livelink Admin >To: tomcat-user@jakarta.apache.org >Date: Monday, February 12, 2001 9:56 PM >Subject: RE: HttpUtil > > > > >A quick read of the docs for Interface ServletRequest reveal a snippet in >the description of function getParameter : > >You should only use this method when you are sure the parameter has only one >value. If the parameter might have more than one value, use >getParameterValues(java.lang.String). > > >getParameterValues >public java.lang.String[] getParameterValues(java.lang.String name) >Returns an array of String objects containing all of the values the given >request parameter has, or null if the parameter does not exist. >If the parameter has a single value, the array has a length of 1. >Parameters: >name - a String containing the name of the parameter whose value is >requested >Returns: >an array of String objects containing the parameter's values >See Also: >getParameter(java.lang.String) > >-----Original Message----- >From: sun [mailto:junxu@silkroute.com] >Sent: Tuesday, February 13, 2001 12:45 PM >To: tomcat-user@jakarta.apache.org >Subject: Re: HttpUtil > > >I only get one, paraname=1, actually I checked 4 boxes, in terms of posted >inputstream, I should get a array of value, it should be paraname=1,2,4,5. >that is why I have to use HttpUtil, but now it is not working, so where is >wrong? maybe I should use servlet instead of jsp, than inputstream will not >be corrupted. > > >-----Original Message----- >From: Chris Janicki >To: tomcat-user@jakarta.apache.org >Date: Monday, February 12, 2001 9:34 PM >Subject: Re: HttpUtil > > >String paraname = request.getParameter("checkboxName"); // 'request' is a >built-in JSP object > > >>>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<< > >On 2/13/01, 12:21:40 PM, "sun" wrote regarding Re: >HttpUtil: > > >> but how to get parameter value passed from previous page, 5 checkbox with >> same name different value, I want to get paraname=1,2,4,5 if I selected 4 >> boxes. > > >> -----Original Message----- >> From: Craig R. McClanahan >> To: tomcat-user@jakarta.apache.org >> Date: Monday, February 12, 2001 9:14 PM >> Subject: Re: HttpUtil > > >> >sun wrote: >> > >> >> no, I didn't call request before using HttpUtil, HttpUtil was put at >> first >> >> line in .jsp. >> >> >> > >> >But the JSP page did it for you (that is, the generated servlet did). >> > >> >Simply use the standard JSP mechanisms to retrieve request attributes >and >> you >> >should be fine. If you *really* want to process the input data >yourself, >> you >> >should be using a servlet instead of a JSP page. >> > >> >Craig McClanahan >> > >> > >> >> >> >> -----Original Message----- >> >> From: Craig R. McClanahan >> >> To: tomcat-user@jakarta.apache.org >> >> Date: Monday, February 12, 2001 2:48 PM >> >> Subject: Re: HttpUtil >> >> >> >> >sun wrote: >> >> > >> >> >> yes, I tried that, got same error, "short read", >> >> >> in terms of docs, it means posted inputstream is invalid, but I am >not >> >> sure >> >> >> about that. >> >> >> >> >> > >> >> >One reason you could get a "short read" response is if the servlet >> >> container >> >> >has already read the input stream's contents. For example, if you are >> >> >processing a POST request and you have already called something like >> >> >request.getParameter(), the contents of the input stream would have >> already >> >> >been processed. >> >> > >> >> >Craig McClanahan >> >> > >> >> > >> >> > >> >> >--------------------------------------------------------------------- >> >> >To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org >> >> >For additional commands, email: tomcat-user-help@jakarta.apache.org >> >> > >> >> >> >> --------------------------------------------------------------------- >> >> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org >> >> For additional commands, email: tomcat-user-help@jakarta.apache.org >> > >> > >> >--------------------------------------------------------------------- >> >To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org >> >For additional commands, email: tomcat-user-help@jakarta.apache.org >> > > > >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org >> For additional commands, email: tomcat-user-help@jakarta.apache.org > >--------------------------------------------------------------------- >To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org >For additional commands, email: tomcat-user-help@jakarta.apache.org > > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org >For additional commands, email: tomcat-user-help@jakarta.apache.org > >--------------------------------------------------------------------- >To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org >For additional commands, email: tomcat-user-help@jakarta.apache.org > > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org >For additional commands, email: tomcat-user-help@jakarta.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, email: tomcat-user-help@jakarta.apache.org