Results 1 to 1 of 1
  1. #1
    ashok bhagat is offline Member
    Join Date
    Nov 2010
    Rep Power

    Angry How to get the header which is set in HttpServletResponse object

    I am testing the code using TestNG. In the code which I am testing the header is set into HttpServletResponse object for each error/exception occurred. I want to retrieve that response header into my file using which I am testing the code .

    Following is the snippet of the code I am testing. the code is written in doFilter method.

    if (header == null) {" filter- Authorization Header is not recieved");httpRes.setStatus(HttpServletResponse.S C_UNAUTHORIZED);
    httpRes.setHeader("x-auth-status", "3401b");


    I want to retrieve the response header in another test file. I cant modify the file which I am testing.

    Please reply its urgent.............
    Last edited by ashok bhagat; 09-09-2011 at 11:50 AM.

Similar Threads

  1. How to get content from HttpServletResponse
    By sumved.shami in forum Java Servlet
    Replies: 4
    Last Post: 02-02-2012, 05:58 AM
  2. The code of method _jspService(HttpServletRequest, HttpServletResponse) is exceeding
    By dickydevry in forum JavaServer Pages (JSP) and JSTL
    Replies: 2
    Last Post: 08-31-2010, 11:02 AM
  3. Fixed Header
    By Quirl in forum New To Java
    Replies: 2
    Last Post: 07-28-2010, 11:19 PM
  4. Header/Footer
    By selva.bics in forum New To Java
    Replies: 0
    Last Post: 11-26-2009, 03:26 PM
  5. header of jtable
    By bbq in forum AWT / Swing
    Replies: 1
    Last Post: 07-05-2007, 05:11 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts