RE: HttpUtil

2001-02-13 Thread Cox, Charlie
Title: RE: HttpUtil





you should actually use :


String[] paranames = request.getParameterValues(checkboxName); 


then you should be able to use paranames[0],paranames[1]...to get your values.



-Original Message-
From: sun [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 13, 2001 12:45 PM
To: [EMAIL PROTECTED]
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 [EMAIL PROTECTED]
To: [EMAIL PROTECTED] [EMAIL PROTECTED]
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 [EMAIL PROTECTED] 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 [EMAIL PROTECTED]
 To: [EMAIL PROTECTED] [EMAIL PROTECTED]
 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 [EMAIL PROTECTED]
  To: [EMAIL PROTECTED] [EMAIL PROTECTED]
  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: [EMAIL PROTECTED]
  For additional commands, email: [EMAIL PROTECTED]
  
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, email: [EMAIL PROTECTED]
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]
 



 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]





RE: HttpUtil

2001-02-13 Thread Randy Layman


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:[EMAIL PROTECTED]]
Sent: Tuesday, February 13, 2001 1:58 PM
To: [EMAIL PROTECTED]
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 [EMAIL PROTECTED]
To: [EMAIL PROTECTED] [EMAIL PROTECTED]
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:[EMAIL PROTECTED]]
Sent: Tuesday, February 13, 2001 12:45 PM
To: [EMAIL PROTECTED]
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 [EMAIL PROTECTED]
To: [EMAIL PROTECTED] [EMAIL PROTECTED]
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" [EMAIL PROTECTED] 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 [EMAIL PROTECTED]
 To: [EMAIL PROTECTED] [EMAIL PROTECTED]
 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 [EMAIL PROTECTED]
  To: [EMAIL PROTECTED] [EMAIL PROTECTED]
  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: [EMAIL PROTECTED]
  For additional commands, email: [EMAIL PROTECTED]
  
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, email: [EMAIL PROTECTED]
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]
 


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




RE: HttpUtil

2001-02-13 Thread CPC Livelink Admin


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 :
HTML
HEAD
/HEAD
BODY
%
String []vals = request.getParameterValues("foo");
if (vals != null)
{
for (int i = 0; i  vals.length; i++)
{
%
LI[%= vals[i] %]/LI
%
}
}
%

BRHR

FORM METHOD="get" action="foo.jsp" 
INPUT TYPE="checkbox" name="foo" VALUE="Bar1"Foo/INPUT
INPUT TYPE="checkbox" name="foo" VALUE="Bar2"Foo/INPUT
INPUT TYPE="checkbox" name="foo" VALUE="Bar3"Foo/INPUT
INPUT TYPE="checkbox" name="foo" VALUE="Bar4"Foo/INPUT
INPUT TYPE="checkbox" name="foo" VALUE="Bar5"Foo/INPUT
INPUT TYPE="checkbox" name="foo" VALUE="Bar6"Foo/INPUT

INPUT type="submit" name="submit" value="sUbmit" /
/FORM

/BODY
/HTML

-Original Message-
From: Randy Layman [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 13, 2001 7:35 AM
To: [EMAIL PROTECTED]
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:[EMAIL PROTECTED]]
Sent: Tuesday, February 13, 2001 1:58 PM
To: [EMAIL PROTECTED]
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 [EMAIL PROTECTED]
To: [EMAIL PROTECTED] [EMAIL PROTECTED]
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:[EMAIL PROTECTED]]
Sent: Tuesday, February 13, 2001 12:45 PM
To: [EMAIL PROTECTED]
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 [EMAIL PROTECTED]
To: [EMAIL PROTECTED] [EMAIL PROTECTED]
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" [EMAIL PROTECTED] 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 [EMAIL PROTECTED]
 To: [EMAIL PROTECTED] [EMAIL PROTECTED]
 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 [EMAIL PROTECTED]
  To: [EMAIL PROTECTED] [EMAIL PROTECTED]
  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 se

Re: HttpUtil

2001-02-13 Thread sun
Title: RE: HttpUtil




yes, I can get String[] paranames, 
five values, 1,2,3,4,5, but I only checked 1,2,4, how can I get these three 
values? if use HttpUtil, I can get directly checkboxname=1,2,4

-Original Message-From: 
Cox, Charlie [EMAIL PROTECTED]To: '[EMAIL PROTECTED]' 
[EMAIL PROTECTED]Date: 
Tuesday, February 13, 2001 6:48 AMSubject: RE: 
HttpUtil
you should actually use : 
String[] paranames = 
request.getParameterValues(checkboxName); 
then you should be able to use 
paranames[0],paranames[1]...to get your values. 
-Original Message- From: sun 
[mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, February 13, 2001 12:45 PM To: [EMAIL PROTECTED] 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 [EMAIL PROTECTED] To: 
[EMAIL PROTECTED] [EMAIL PROTECTED] 
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 
[EMAIL PROTECTED] 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 [EMAIL PROTECTED] 
 To: [EMAIL PROTECTED] 
[EMAIL PROTECTED]  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 
[EMAIL PROTECTED]   
To: [EMAIL PROTECTED] 
[EMAIL PROTECTED]   
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   
sureabout 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: 
[EMAIL PROTECTED]  
 For additional commands, email: 
[EMAIL PROTECTED]   

 
- 
  To unsubscribe, e-mail: 
[EMAIL PROTECTED]  
 For additional commands, email: 
[EMAIL PROTECTED]   
   
- 
 To unsubscribe, e-mail: 
[EMAIL PROTECTED]  
For additional commands, email: 
[EMAIL PROTECTED]   

 
- 
 To unsubscribe, e-mail: 
[EMAIL PROTECTED]  For 
additional commands, email: [EMAIL PROTECTED] 
- 
To unsubscribe, e-mail: 
[EMAIL PROTECTED] For 
additional commands, email: [EMAIL PROTECTED] 

- 
To unsubscribe, e-mail: 
[EMAIL PROTECTED] For 
additional commands, email: [EMAIL PROTECTED] 



Re: HttpUtil

2001-02-13 Thread sun

Randy:
I am not sure what is problem, if because of HTML, what is possible issues?
I tried on different server, different browser, all get same error: short
read.

rgds
sun


-Original Message-
From: Randy Layman [EMAIL PROTECTED]
To: [EMAIL PROTECTED] [EMAIL PROTECTED]
Date: Tuesday, February 13, 2001 7:10 AM
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:[EMAIL PROTECTED]]
Sent: Tuesday, February 13, 2001 1:58 PM
To: [EMAIL PROTECTED]
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 [EMAIL PROTECTED]
To: [EMAIL PROTECTED] [EMAIL PROTECTED]
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:[EMAIL PROTECTED]]
Sent: Tuesday, February 13, 2001 12:45 PM
To: [EMAIL PROTECTED]
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 [EMAIL PROTECTED]
To: [EMAIL PROTECTED] [EMAIL PROTECTED]
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" [EMAIL PROTECTED] 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 [EMAIL PROTECTED]
 To: [EMAIL PROTECTED] [EMAIL PROTECTED]
 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 [EMAIL PROTECTED]
  To: [EMAIL PROTECTED] [EMAIL PROTECTED]
  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: [EMAIL PROTECTED]
  For additional commands, email: [EMAIL PROTECTED]
  
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, email: [EMAIL PROTECTED]
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]
 


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For addi

Re: HttpUtil

2001-02-13 Thread sun

yes, for get method, it is working, but I have to use post method.

rgds
sun


-Original Message-
From: CPC Livelink Admin [EMAIL PROTECTED]
To: [EMAIL PROTECTED] [EMAIL PROTECTED]
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 :
HTML
 HEAD
 /HEAD
 BODY
%
 String []vals = request.getParameterValues("foo");
 if (vals != null)
 {
 for (int i = 0; i  vals.length; i++)
 {
 %
 LI[%= vals[i] %]/LI
 %
 }
 }
%

 BRHR

 FORM METHOD="get" action="foo.jsp" 
 INPUT TYPE="checkbox" name="foo" VALUE="Bar1"Foo/INPUT
 INPUT TYPE="checkbox" name="foo" VALUE="Bar2"Foo/INPUT
 INPUT TYPE="checkbox" name="foo" VALUE="Bar3"Foo/INPUT
 INPUT TYPE="checkbox" name="foo" VALUE="Bar4"Foo/INPUT
 INPUT TYPE="checkbox" name="foo" VALUE="Bar5"Foo/INPUT
 INPUT TYPE="checkbox" name="foo" VALUE="Bar6"Foo/INPUT

 INPUT type="submit" name="submit" value="sUbmit" /
 /FORM

/BODY
/HTML

-Original Message-
From: Randy Layman [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 13, 2001 7:35 AM
To: [EMAIL PROTECTED]
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:[EMAIL PROTECTED]]
Sent: Tuesday, February 13, 2001 1:58 PM
To: [EMAIL PROTECTED]
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 [EMAIL PROTECTED]
To: [EMAIL PROTECTED] [EMAIL PROTECTED]
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:[EMAIL PROTECTED]]
Sent: Tuesday, February 13, 2001 12:45 PM
To: [EMAIL PROTECTED]
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 [EMAIL PROTECTED]
To: [EMAIL PROTECTED] [EMAIL PROTECTED]
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" [EMAIL PROTECTED] 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 [EMAIL PROTECTED]
 To: [EMAIL PROTECTED] [EMAIL PROTECTED]
 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 [EMAIL PROTECTED]
  To: [EMAIL PROTECTED] [EMAIL PROTECTED]
  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 req

RE: HttpUtil

2001-02-13 Thread CPC Livelink Admin


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:[EMAIL PROTECTED]]
Sent: Wednesday, February 14, 2001 10:15 AM
To: [EMAIL PROTECTED]
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 [EMAIL PROTECTED]
To: [EMAIL PROTECTED] [EMAIL PROTECTED]
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 :
HTML
 HEAD
 /HEAD
 BODY
%
 String []vals = request.getParameterValues("foo");
 if (vals != null)
 {
 for (int i = 0; i  vals.length; i++)
 {
 %
 LI[%= vals[i] %]/LI
 %
 }
 }
%

 BRHR

 FORM METHOD="get" action="foo.jsp" 
 INPUT TYPE="checkbox" name="foo" VALUE="Bar1"Foo/INPUT
 INPUT TYPE="checkbox" name="foo" VALUE="Bar2"Foo/INPUT
 INPUT TYPE="checkbox" name="foo" VALUE="Bar3"Foo/INPUT
 INPUT TYPE="checkbox" name="foo" VALUE="Bar4"Foo/INPUT
 INPUT TYPE="checkbox" name="foo" VALUE="Bar5"Foo/INPUT
 INPUT TYPE="checkbox" name="foo" VALUE="Bar6"Foo/INPUT

 INPUT type="submit" name="submit" value="sUbmit" /
 /FORM

/BODY
/HTML

-Original Message-
From: Randy Layman [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 13, 2001 7:35 AM
To: [EMAIL PROTECTED]
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:[EMAIL PROTECTED]]
Sent: Tuesday, February 13, 2001 1:58 PM
To: [EMAIL PROTECTED]
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 [EMAIL PROTECTED]
To: [EMAIL PROTECTED] [EMAIL PROTECTED]
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:[EMAIL PROTECTED]]
Sent: Tuesday, February 13, 2001 12:45 PM
To: [EMAIL PROTECTED]
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 [EMAIL PROTECTED]
To: [EMAIL PROTECTED] [EMAIL PROTECTED]
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" [EMAIL PROTECTED] 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 [EMAIL PROTECTED]
 To: [EMAIL PROTECTED] [EMAIL PROTECTED]
 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 [EMAIL PROTECTED]
  To: [EMAIL PROTECTED] [EMAIL PROTECTED

Re: HttpUtil

2001-02-13 Thread sun

yes, it is working. Thank you very much.

rgds
sun


-Original Message-
From: CPC Livelink Admin [EMAIL PROTECTED]
To: [EMAIL PROTECTED] [EMAIL PROTECTED]
Date: Tuesday, February 13, 2001 9:43 PM
Subject: RE: HttpUtil



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:[EMAIL PROTECTED]]
Sent: Wednesday, February 14, 2001 10:15 AM
To: [EMAIL PROTECTED]
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 [EMAIL PROTECTED]
To: [EMAIL PROTECTED] [EMAIL PROTECTED]
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 :
HTML
 HEAD
 /HEAD
 BODY
%
 String []vals = request.getParameterValues("foo");
 if (vals != null)
 {
 for (int i = 0; i  vals.length; i++)
 {
 %
 LI[%= vals[i] %]/LI
 %
 }
 }
%

 BRHR

 FORM METHOD="get" action="foo.jsp" 
 INPUT TYPE="checkbox" name="foo" VALUE="Bar1"Foo/INPUT
 INPUT TYPE="checkbox" name="foo" VALUE="Bar2"Foo/INPUT
 INPUT TYPE="checkbox" name="foo" VALUE="Bar3"Foo/INPUT
 INPUT TYPE="checkbox" name="foo" VALUE="Bar4"Foo/INPUT
 INPUT TYPE="checkbox" name="foo" VALUE="Bar5"Foo/INPUT
 INPUT TYPE="checkbox" name="foo" VALUE="Bar6"Foo/INPUT

 INPUT type="submit" name="submit" value="sUbmit" /
 /FORM

/BODY
/HTML

-Original Message-
From: Randy Layman [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 13, 2001 7:35 AM
To: [EMAIL PROTECTED]
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:[EMAIL PROTECTED]]
Sent: Tuesday, February 13, 2001 1:58 PM
To: [EMAIL PROTECTED]
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 [EMAIL PROTECTED]
To: [EMAIL PROTECTED] [EMAIL PROTECTED]
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:[EMAIL PROTECTED]]
Sent: Tuesday, February 13, 2001 12:45 PM
To: [EMAIL PROTECTED]
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 [EMAIL PROTECTED]
To: [EMAIL PROTECTED] [EMAIL PROTECTED]
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" [EMAIL PROTECTED] 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 [EMAIL PROTECTED]
 To: [EMAIL PROTECTED] [EMAIL PROTECTED]
 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 proces

Re: HttpUtil

2001-02-12 Thread Craig R. McClanahan

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: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: HttpUtil

2001-02-12 Thread sun

no, I didn't call request before using HttpUtil, HttpUtil was put at first
line in .jsp.


-Original Message-
From: Craig R. McClanahan [EMAIL PROTECTED]
To: [EMAIL PROTECTED] [EMAIL PROTECTED]
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: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: HttpUtil

2001-02-12 Thread sun

Craig McClanahan:

I have a session bean in previous page, do I have to terminate this session
bean? does this session bean affect current page? how to terminate a session
bean if I don't shut down my servlet container?

rgds
sun

-Original Message-
From: local [EMAIL PROTECTED]
To: [EMAIL PROTECTED] [EMAIL PROTECTED]
Date: Tuesday, February 13, 2001 10:56 AM
Subject: Re: HttpUtil


no, I didn't call request before using HttpUtil, HttpUtil was put at first
line in .jsp.


-Original Message-
From: Craig R. McClanahan [EMAIL PROTECTED]
To: [EMAIL PROTECTED] [EMAIL PROTECTED]
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: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: HttpUtil

2001-02-12 Thread Craig R. McClanahan

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 [EMAIL PROTECTED]
 To: [EMAIL PROTECTED] [EMAIL PROTECTED]
 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: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]
 

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: HttpUtil

2001-02-12 Thread Craig R. McClanahan

sun wrote:

 Craig McClanahan:

 I have a session bean in previous page, do I have to terminate this session
 bean? does this session bean affect current page? how to terminate a session
 bean if I don't shut down my servlet container?


Call session.invalidate();

You might want to review some of the tutorials on basic JSP and servlet
programming -- a good starting point are the Sun web sites:

http://java.sun.com/products/jsp
http://java.sun.com/products/servlet


 rgds
 sun


Craig



 -Original Message-
 From: local [EMAIL PROTECTED]
 To: [EMAIL PROTECTED] [EMAIL PROTECTED]
 Date: Tuesday, February 13, 2001 10:56 AM
 Subject: Re: HttpUtil

 no, I didn't call request before using HttpUtil, HttpUtil was put at first
 line in .jsp.
 
 
 -Original Message-
 From: Craig R. McClanahan [EMAIL PROTECTED]
 To: [EMAIL PROTECTED] [EMAIL PROTECTED]
 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: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]
 
 

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: HttpUtil

2001-02-12 Thread sun

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 [EMAIL PROTECTED]
To: [EMAIL PROTECTED] [EMAIL PROTECTED]
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 [EMAIL PROTECTED]
 To: [EMAIL PROTECTED] [EMAIL PROTECTED]
 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: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]
 

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: HttpUtil

2001-02-12 Thread Chris Janicki

String paraname = request.getParameter("checkboxName"); // 'request' is a 
built-in JSP object


 Original Message 

On 2/13/01, 12:21:40 PM, "sun" [EMAIL PROTECTED] 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 [EMAIL PROTECTED]
 To: [EMAIL PROTECTED] [EMAIL PROTECTED]
 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 [EMAIL PROTECTED]
  To: [EMAIL PROTECTED] [EMAIL PROTECTED]
  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: [EMAIL PROTECTED]
  For additional commands, email: [EMAIL PROTECTED]
  
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, email: [EMAIL PROTECTED]
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]
 


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: HttpUtil

2001-02-12 Thread sun

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 [EMAIL PROTECTED]
To: [EMAIL PROTECTED] [EMAIL PROTECTED]
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" [EMAIL PROTECTED] 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 [EMAIL PROTECTED]
 To: [EMAIL PROTECTED] [EMAIL PROTECTED]
 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 [EMAIL PROTECTED]
  To: [EMAIL PROTECTED] [EMAIL PROTECTED]
  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: [EMAIL PROTECTED]
  For additional commands, email: [EMAIL PROTECTED]
  
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, email: [EMAIL PROTECTED]
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]
 


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




RE: HttpUtil

2001-02-12 Thread CPC Livelink Admin
Title: 



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).
getParameterValuespublic java.lang.String[] getParameterValues(java.lang.Stringname)

  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:[EMAIL PROTECTED]]Sent: 
Tuesday, February 13, 2001 12:45 PMTo: 
[EMAIL PROTECTED]Subject: Re: HttpUtilI only get 
one, paraname=1, actually I checked 4 boxes, in terms of postedinputstream, 
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 iswrong? maybe I 
should use servlet instead of jsp, than inputstream will notbe 
corrupted.-Original Message-From: Chris Janicki 
[EMAIL PROTECTED]To: [EMAIL PROTECTED] 
[EMAIL PROTECTED]Date: Monday, February 12, 2001 9:34 
PMSubject: Re: HttpUtilString paraname = 
request.getParameter("checkboxName"); // 'request' is abuilt-in JSP 
object 
Original Message 
On 
2/13/01, 12:21:40 PM, "sun" [EMAIL PROTECTED] 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 
[EMAIL PROTECTED] To: [EMAIL PROTECTED] 
[EMAIL PROTECTED] 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 attributesand you should be fine. 
If you *really* want to process the input datayourself, you 
should be using a servlet instead of a JSP page.  
Craig McClanahan 
-Original Message-  From: Craig R. McClanahan 
[EMAIL PROTECTED]  To: 
[EMAIL PROTECTED] [EMAIL PROTECTED] 
 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 amnot  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: 
[EMAIL PROTECTED]  For additional 
commands, email: [EMAIL PROTECTED]  
   
- 
 To unsubscribe, e-mail: 
[EMAIL PROTECTED]  For additional 
commands, email: [EMAIL PROTECTED]  
 
- 
To unsubscribe, e-mail: [EMAIL PROTECTED] 
For additional commands, email: [EMAIL PROTECTED] 
 
- To 
unsubscribe, e-mail: [EMAIL PROTECTED] For 
additional commands, email: 
[EMAIL PROTECTED]-To 
unsubscribe, e-mail: [EMAIL PROTECTED]For 
additional commands, email: 
[EMAIL PROTECTED]-To 
unsubscribe, e-mail: [EMAIL PROTECTED]For 
additional commands, email: 
[EMAIL PROTECTED]


Re: HttpUtil

2001-02-12 Thread sun




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 [EMAIL PROTECTED]To: 
[EMAIL PROTECTED] 
[EMAIL PROTECTED]Date: 
Monday, February 12, 2001 9:56 PMSubject: 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).
getParameterValuespublic java.lang.String[] getParameterValues(java.lang.Stringname)

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:[EMAIL PROTECTED]]Sent: 
Tuesday, February 13, 2001 12:45 PMTo: 
[EMAIL PROTECTED]Subject: Re: HttpUtilI only 
get one, paraname=1, actually I checked 4 boxes, in terms of 
postedinputstream, 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 iswrong? maybe I should use servlet instead of jsp, 
than inputstream will notbe corrupted.-Original 
Message-From: Chris Janicki [EMAIL PROTECTED]To: 
[EMAIL PROTECTED] 
[EMAIL PROTECTED]Date: Monday, February 12, 2001 
9:34 PMSubject: Re: HttpUtilString paraname = 
request.getParameter(checkboxName); // 'request' is 
abuilt-in JSP 
object 
Original Message 
On 
2/13/01, 12:21:40 PM, sun [EMAIL PROTECTED] 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 [EMAIL PROTECTED] To: 
[EMAIL PROTECTED] 
[EMAIL PROTECTED] 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 
attributesand you should be fine. If you 
*really* want to process the input datayourself, you 
should be using a servlet instead of a JSP page.  
Craig McClanahan
 -Original Message-  From: Craig R. 
McClanahan [EMAIL PROTECTED]  To: 
[EMAIL PROTECTED] 
[EMAIL PROTECTED]  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 amnot  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: 
[EMAIL PROTECTED]  For 
additional commands, email: [EMAIL PROTECTED] 

- 
 To unsubscribe, e-mail: 
[EMAIL PROTECTED]  For additional 
commands, email: [EMAIL PROTECTED]  
 
- 
To unsubscribe, e-mail: 
[EMAIL PROTECTED] For additional 
commands, email: [EMAIL PROTECTED] 
 
- 
To unsubscribe, e-mail: [EMAIL PROTECTED] 
For additional commands, email: 
[EMAIL PROTECTED]-To 
unsubscribe, e-mail: [EMAIL PROTECTED]For 
additional commands, email: 
[EMAIL PROTECTED]-To 
unsubscribe, e-mail: [EMAIL PROTECTED]For 
additional commands, email: 
[EMAIL PROTECTED]


Re: HttpUtil

2001-02-11 Thread Chris Janicki

Wouldn't that be the value of the request's "Content-length"?

 Original Message 

On 2/12/01, 10:39:27 AM, "sun" [EMAIL PROTECTED] wrote regarding 
HttpUtil:


 hi, there,
 I use HttpUtil to get post data, but always get error: short read.
 what is wrong? in
 parsePostData(int len, ServletInputStream in) ,
 which number should I assign to 'len'?

 thanks.

 rgds
 sun


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: HttpUtil

2001-02-11 Thread sun

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.


-Original Message-
From: Chris Janicki [EMAIL PROTECTED]
To: [EMAIL PROTECTED] [EMAIL PROTECTED]
Date: Sunday, February 11, 2001 9:07 PM
Subject: Re: HttpUtil


Wouldn't that be the value of the request's "Content-length"?

 Original Message 

On 2/12/01, 10:39:27 AM, "sun" [EMAIL PROTECTED] wrote regarding
HttpUtil:


 hi, there,
 I use HttpUtil to get post data, but always get error: short read.
 what is wrong? in
 parsePostData(int len, ServletInputStream in) ,
 which number should I assign to 'len'?

 thanks.

 rgds
 sun


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: HttpUtil

2001-02-11 Thread Chris Janicki

Hmmm... you can always try to look at the source code for 
parsePostData()... that is the beauty of open-source.  

 Original Message 

On 2/12/01, 12:14:52 PM, "sun" [EMAIL PROTECTED] wrote regarding Re: 
HttpUtil:


 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.


 -Original Message-
 From: Chris Janicki [EMAIL PROTECTED]
 To: [EMAIL PROTECTED] [EMAIL PROTECTED]
 Date: Sunday, February 11, 2001 9:07 PM
 Subject: Re: HttpUtil


 Wouldn't that be the value of the request's "Content-length"?

  Original Message 

 On 2/12/01, 10:39:27 AM, "sun" [EMAIL PROTECTED] wrote regarding
 HttpUtil:


  hi, there,
  I use HttpUtil to get post data, but always get error: short read.
  what is wrong? in
  parsePostData(int len, ServletInputStream in) ,
  which number should I assign to 'len'?

  thanks.

  rgds
  sun


  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, email: [EMAIL PROTECTED]

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]



 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: HttpUtil

2001-02-11 Thread sun

I read it, suspect problem is on webserver or tomcat, they cann't handle
inputstream well, but how to resolve it? what is real problem? am I right to
say "short read" is inputstream's error?


-Original Message-
From: Chris Janicki [EMAIL PROTECTED]
To: [EMAIL PROTECTED] [EMAIL PROTECTED]
Date: Sunday, February 11, 2001 10:02 PM
Subject: Re: HttpUtil


Hmmm... you can always try to look at the source code for
parsePostData()... that is the beauty of open-source.

 Original Message 

On 2/12/01, 12:14:52 PM, "sun" [EMAIL PROTECTED] wrote regarding Re:
HttpUtil:


 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.


 -Original Message-
 From: Chris Janicki [EMAIL PROTECTED]
 To: [EMAIL PROTECTED] [EMAIL PROTECTED]
 Date: Sunday, February 11, 2001 9:07 PM
 Subject: Re: HttpUtil


 Wouldn't that be the value of the request's "Content-length"?

  Original Message 

 On 2/12/01, 10:39:27 AM, "sun" [EMAIL PROTECTED] wrote regarding
 HttpUtil:


  hi, there,
  I use HttpUtil to get post data, but always get error: short read.
  what is wrong? in
  parsePostData(int len, ServletInputStream in) ,
  which number should I assign to 'len'?

  thanks.

  rgds
  sun


  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, email: [EMAIL PROTECTED]

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]



 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]