Results 1 to 6 of 6

Thread: Viewing HttpServletResponse

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2003
    Posts
    1,004

    Viewing HttpServletResponse

    Is there a way to view the contents of HttpServletResponse?

    Thank you.
    "Can't" and "shouldn't" are two totally separate things.

    All questions should be answered. All answers should be true. That is why I post.

  2. #2
    PowerPoster eranga262154's Avatar
    Join Date
    Jun 2006
    Posts
    2,201

    Re: Viewing HttpServletResponse

    I'm not sure, may be you can use interface called javax.servlet.ServletResponse. One of our Java project we use it to find the set and find the header of a message packet of a chat service.

    May be you can find some useful details from there.
    “victory breeds hatred, the defeated live in pain; happily the peaceful live giving up victory and defeat” - Gautama Buddha

  3. #3
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: Viewing HttpServletResponse

    I guess the HttpServletResponseWrapper is what you're looking for.

    Quote Originally Posted by JavaDoc
    Provides a convenient implementation of the HttpServletResponse interface that can be subclassed by developers wishing to adapt the response from a Servlet. This class implements the Wrapper or Decorator pattern. Methods default to calling through to the wrapped response object.
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2003
    Posts
    1,004

    Re: Viewing HttpServletResponse

    HttpServletResponseWrapper is not quite what I am looking for.

    The ServletRequest object has a method called getReader() that will allow me to view the contents of the body. Is there something analogous to this functionality in ServletResponse?
    "Can't" and "shouldn't" are two totally separate things.

    All questions should be answered. All answers should be true. That is why I post.

  5. #5
    PowerPoster eranga262154's Avatar
    Join Date
    Jun 2006
    Posts
    2,201

    Re: Viewing HttpServletResponse

    Did you check the documentation. As far as I remember there is a method as getStream() or getData(), better to check I'm not sure that 100%
    “victory breeds hatred, the defeated live in pain; happily the peaceful live giving up victory and defeat” - Gautama Buddha

  6. #6

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2003
    Posts
    1,004

    Re: Viewing HttpServletResponse

    I did not see a getStream() or getData() method in the HttpServletResponse object in the javadocs (http://java.sun.com/products/servlet...mr2/index.html)

    If there is no way to get the contents of the HttpServletResponse after you written to the object, then why was this functionality excluded?
    "Can't" and "shouldn't" are two totally separate things.

    All questions should be answered. All answers should be true. That is why I post.

Posting Permissions

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



Click Here to Expand Forum to Full Width