hi andy

instead of reading from the inputstream directly.
try the following code

Enumeration headers=request.getHeaderNames();
while(headers.hasMoreElements()){
        String headname= (String)headers.nextElement();
        out.println(request.getHeader(headname));
}

regards
Anup



At 07:21 PM 7/19/00 +0200, you wrote:
>Hi all,
>
>I am unsuccessfully trying to display the "raw" HTTP header that gets sent
>to my server.
>I have written the code below, but the BufferedReader returns no data at
>all. In fact
>the print statement displays "Ready: false" indicating there is no data. I
>am running the
>servlet on Oracle Application Server.
>
>All ideas welcome, as I desperately need this to work to troubleshoot a WAP
>gateway.
>
>Regards,
>
>Andy
>---
>www.andymayer.com
>
>
>public class Header extends HttpServlet {
>
>public void service ( HttpServletRequest request, HttpServletResponse
>response)
>throws ServletException, IOException {
>
>     response.setContentType("text/html");
>    PrintWriter out = response.getWriter();
>
>    ServletInputStream inStream = request.getInputStream();
>    InputStreamReader inputStreamReader = new InputStreamReader(inStream);
>    out.println("Ready : "+inputStreamReader.ready());
>
>    BufferedReader in = new BufferedReader(inputStreamReader);
>
>    String inputLine;
>    while ((inputLine = in.readLine()) != null) {
>         out.println(inputLine);
>}
>
>___________________________________________________________________________
>To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
>of the message "signoff SERVLET-INTEREST".
>
>Archives: http://archives.java.sun.com/archives/servlet-interest.html
>Resources: http://java.sun.com/products/servlet/external-resources.html
>LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to