Regarding your other question: "how is my own answer a little reconciled with the answer created by the JSP that resolves" myViewName ".
When you return the view "myViewName", it will be allowed for a specific resource (JSP View or JSON View or any other kind). As soon as this view resource is received depending on what you return, this view renders a response. This response object is the same as passed to the controller function (myController). Tell me, if you set some cookies / response headers in the controller function, the response that the view uses to render will also have the same properties.
If you want to handle the actual rendering / response yourself, you can always get the response output stream and write to it and close the stream. Then, the view you return is simply ignored, because the dispatcher checks that the response has already been processed and will simply process the messages.
Hope this clears up for anyone looking for dispatcher logic.
source share