Use ViewResolver in Spring MVC
view resolver is a class in spring framework which allows us to configure urls dynamically ctrl + shift + T to open type in eclipse, search *Viewresolver you will find InternalResourceViewResolver this class will do it automatically.Make a bean of this class in mainController-servlet.xml file (