Today I’m working on a project in Java Spring, especially in CONTEXT-SERVLET.xml (context) where normally declare a bean to link a .jsp with a Java class or controller (mapping).
Traditional workflow is: a viewA.jsp is linked (mapping) to controller.java (controller) and this controller.java dispatches another viewB.jsp.
Can you link a viewA.jsp to another viewB.Jsp without going through a controller?
How do this in CONTEXT-SERVLET.xml?
You can use
ParameterizableViewControllerto redirect a request to jsp file without visiting controller.For example
1. Mapping
/welcome.htmtowelcomeController2. Mapping
viewNameproperty ofwelcomeControllertoWelcomePage3. Defining view resolver
It will map
/welcome.htmto/WEB-INF/pages/welcomePage.jsp.Source for more details.