Câu hỏi phỏng vấn Spring
Câu hỏi

How is the right View chosen when it comes to the rendering phase?

Câu trả lời

In Spring MVC, the correct view is chosen during the rendering phase through the use of a ViewResolver. The process begins when the controller processes a request and returns a logical view name. This logical view name is then passed to the ViewResolver, which is responsible for mapping this name to an actual view technology, such as a JSP file.

The ViewResolver configuration determines how the logical view names are mapped to actual view paths. For example, the InternalResourceViewResolver can be configured with a prefix and a suffix to resolve the view names to specific JSP paths. If a controller returns "hello" as a logical view name, and the InternalResourceViewResolver is configured with a prefix of "/WEB-INF/views/" and a suffix of ".jsp", it would resolve the logical view name "hello" to the path "/WEB-INF/views/hello.jsp". The DispatcherServlet then forwards the request to this JSP page for re...

middle

middle

Gợi ý câu hỏi phỏng vấn

middle

What are the types of the transaction management Spring supports?

junior

What is a View and what's the idea behind supporting different types of View?

junior

What is the purpose of the Core Container module?

Bình luận

Chưa có bình luận nào

Chưa có bình luận nào