Results 1 to 4 of 4

Thread: Working with the servlet output stream directly

  1. #1
    Join Date
    Oct 2004
    Posts
    22

    Default Working with the servlet output stream directly

    I have created a number of Views that manage the response stream themselves. The data i have is not html and is constructed dynamically so i don't need any templates, jsps, etc. Can someone comment on the best practice for doing this.

    I am extending AbstractView and overriding renderMergedOutputModel. I set the content type and character encoding and write the data out. Should i now flush and close the output stream? Is this something that the spring framework and/or application server takes care off?

    cheers

  2. #2
    Join Date
    Sep 2008
    Location
    London, UK
    Posts
    155

    Default

    The application server takes care of flush and close. You can work with the stream using more specialized spring view classes as well, i.e if a view and a model is expected as a return you simply return null.

    Cheers

    G

  3. #3
    Join Date
    Oct 2004
    Posts
    22

    Default

    Which view classes would be best? To give you an idea of what i am doing, I need to output X<L generated by JAXB, and text/plain messages. Is there and spring support for any of these?

    cheers

  4. #4
    Join Date
    Jul 2008
    Posts
    239

    Default

    I think that u dont need any more layers of abstraction. You can use direct OOP in conjunction with the controller, in the case of JAXB.

Posting Permissions

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