Forums Register Login

Reading int headers from a Servlet

+Pie Number of slices to send: Send
Hello All,
I'm trying to read an int header from the request in doGet() method.


But, on the browser I'm getting -1 for both the headers. Why is that so?
Any help shall be highly appreciated.

Thanks,
Reema
+Pie Number of slices to send: Send
According to JavaDoc.

public int getIntHeader(java.lang.String name)

The default behavior of this method is to return getIntHeader(String name) on the wrapped request object.

Specified by:
getIntHeader in interface HttpServletRequest

Following copied from interface: javax.servlet.http.HttpServletRequest

Parameters:
name - a String specifying the name of a request header
Returns:
an integer expressing the value of the request header or -1 if the request doesn't have a header of this name
Throws:
java.lang.NumberFormatException - If the header value can't be converted to an int



hope it makes you clear..
[ February 24, 2007: Message edited by: Saif uddin ]
+Pie Number of slices to send: Send
 

Originally posted by Reema Patel:
Hello All,
I'm trying to read an int header from the request in doGet() method.


But, on the browser I'm getting -1 for both the headers. Why is that so?
Any help shall be highly appreciated.

Thanks,
Reema



You can use any tool that shows you the raw HTTP request.That will help you to see what exatcly the browser is sending..
you can use tcpmon , this somes with axis and there are many more in the web.
My name is Inigo Montoya, you killed my father, prepare to read a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1137 times.
Similar Threads
Break Down Paragraph Text
whilst fooling around with SessionId and cookies...
If no matching records found, how do I display a message?
problem with setContentType() method
Connection Pooling
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 23:04:28.