Returning data from a controller
Hi, I'm wondering if there's a way to plug a controller-like component able to return something which is not a view but instead some other kind of content, like an image, a file or an arbitrary resource.
Please sign in to leave a comment.
Of course. Just extend BaseController class and write everything you want to the stream obtained from the HttpResponse object.
Am I not supposed to override the abstract doHandle method which returns ModelAndView? What would I return there?
Sorry, forgot about this. You can just return null here.
Thanks, I didn't know I could just retrurn null.