Configure the Spring Dispatcher Servlet using all Java Code (no xml)

Here are the steps


1. Delete the files: web.xml file and spring-mvc-demo-servlet.xml files
2. Create a new Java package: com.luv2code.springdemo.config
3. Add the following Java files in your package
File: DemoAppConfig.java

File: MySpringMvcDispatcherServletInitializer.java
4. Test your app
Your app should work as desired.

Comments

Popular posts from this blog

Nginx

AWS Configuration For RDS(postgres),ElastiCache(Redis) with ElasticBean

Use @Initbinder in Spring MVC

CSRF Protection using Synchronizer Tokens

How to read Dates with Hibernate

CSRF Protection using Double Submitted Cookies

Add Logging Messages in Spring 5.1 - All Java Config Version

The TRUE difference between [] and {{}} bindings in Angular

Hibernate and Primary Keys