-
Dec 2nd, 2008, 10:19 AM
#1
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
-
Dec 2nd, 2008, 04:25 PM
#2
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
-
Dec 3rd, 2008, 03:28 AM
#3
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
-
Dec 3rd, 2008, 07:42 AM
#4
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
-
Forum Rules