Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save harshityadav95/f01747627f326cc713bfbec933c807ce to your computer and use it in GitHub Desktop.
Save harshityadav95/f01747627f326cc713bfbec933c807ce to your computer and use it in GitHub Desktop.
ApplicationContextConfiguration for Spring Web application
package learnmavenone;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.mvc.Controller;
import org.springframework.web.servlet.view.InternalResourceViewResolver;
@Configuration
public class ApplicationContextConfiguration {
@Bean(name="viewResolver")
public InternalResourceViewResolver getViewResolver()
{
InternalResourceViewResolver viewResolver = new InternalResourceViewResolver();
viewResolver.setPrefix("/");
viewResolver.setSuffix(".jsp");
return viewResolver;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment