In this chapter, we learned how InternalResourceViewResolver
resolves views, and we learned how we can kick RedirectView
from a controller method. We learned the important difference between redirect
and forward
. After that, we learned how we can host static resource files without going through the controllers' configuration. We also learned how to attach a static image file with the product details page. We learned how we can upload files to server. Finally, we saw how we can configure ContentNegotiatingViewResolver
to give alternate XML and JSON views for the product domain object in our application. Finally, we learned how we can make use of HandlerExceptionResolver
to resolve an exception.
In the next chapter, we will learn how we can intercept regular web requests with the help of an interceptor. See you in next chapter!