Тёмный

NO WEB.XML ? || Spring MVC Java based configuration || WebApplicationInitializer || Part 2 

Selenium Express
Подписаться 106 тыс.
Просмотров 37 тыс.
50% 1

As we are setting up our spring MVC project with only java code, the first job is to remove any XML file we have. Well, Here is a million-dollar question. Can we run a web app without a web.xml file? If yes, then how? If No, Then why?
Well, the fact is we can deploy a web app without a web.xml file. The only catch is here that we should have the latest servlet container. We should have at least a servlet 3.0 + container to run our web-app to run a java web application.
Now, here comes another question. The web.xml file auto-detected by our webserver. So we do our dispatcher servlet configuration inside the web.xml file. But now as we are going to remove the web.xml file where we are going to write code for dispatcher servlet?
So, We will create a class and, we will implement an interface called WebApplicationInitializer. This interface is given by spring MVC to ensure a code-based configuration. The WebApplicationInitializer ensures that your class will be auto-detected by the webserver like a web.xml file.
The WebApplicationInitializer has a method called on startup that takes a servlet context as an argument. We need to create a dispatcher servlet object and, then we will add it to the servlet context reference. That's it. We are ready to go. The rest will be taken care of by tomcat.
So here is how we can do a spring MVC java based configuration with no web.xml file. The above approach will be a replacement for the web.xml file.
If you are looking for important spring MVC interview questions, It's a good one to prepare.
Any time you are getting stuck with issues, Feel free to ask for support.
#springmvc #WebApplicationInitializer #NoXML
You can send mail to seleniumexpress@gmail.com
you can ping me on my Facebook page.
/ seleniumexpress
Make sure to join my private Facebook page.
“SeleniumExpress - Support"
you can ask for support in my website forum.
www.seleniumex...
Subscribe to my youtube channel.
/ @seleniumexpress
Music :
-----------
credits : -
(intro)
Adventures by A Himitsu / a-himitsu
Creative Commons - Attribution 3.0 Unported- CC BY 3.0
creativecommons....
Music released by Argofox • A Himitsu - Adventures...
Music provided by Audio Library • Adventures - A Himitsu...
intro template :
/ alexbau01

Опубликовано:

 

7 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 43   
@chukwukaegbujio1450
@chukwukaegbujio1450 9 месяцев назад
Putting all that has been learnt years back in a clearer context is a trademark of Abhilash. Relearning the Spring ecosystem has become an interesting journey courtesy of your tutorials
@christopherlament853
@christopherlament853 Год назад
Good morning, afternoon or evening, my name is Christopher and am Nigeria. This guy is the best Mentor i had ever met.
@jonnalkarthik9832
@jonnalkarthik9832 4 года назад
Thank you for creating an environment of enthusiasm for learning.I may not always say it, but I mean it whenever I say it. Thanks alot abhilash ,for all the extra efforts you make to help us grow🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏
@SeleniumExpress
@SeleniumExpress 4 года назад
Thank you,Karthik. Happy to help 😊
@coffeewithjava5625
@coffeewithjava5625 2 года назад
Abhilash , just one thing to say God bless you bro !!! Keep sharing the knowledge as very few have that ability and skill to do. You are simply too good
@tusharagarwal3475
@tusharagarwal3475 4 года назад
I can't explain how much helpful this course is for me thanks for putting your efforts in making videos for us, keep going Bhaiya ,and give deep and deep knowledge about spring .
@himalbajgain2280
@himalbajgain2280 8 месяцев назад
@Abhilash, the way how you present these contents are awesome. I am not skipping any ads. I let ads play full time which might help you somehow. Please everyone, do not skip the ads.
@prashantmore8489
@prashantmore8489 2 года назад
The best playlist on spring . Thank you so much brother 🙏🙏
@AjayGupta-ob8oe
@AjayGupta-ob8oe 4 года назад
Very very thanks Abhilash.It's really very helpful for spring learner. I am waiting your next series of AOP and transaction.
@krishnavidala7296
@krishnavidala7296 4 года назад
Abhilash hat's off for your excellent teaching. Video's are extremely useful for improving the technical career.
@chaitanyavss730
@chaitanyavss730 4 года назад
Very useful...crisp and clear...very nice....Superb explanation
@nikhilwabale4329
@nikhilwabale4329 4 года назад
Ye Banda king hai. Great teaching sir ji
@croissant982
@croissant982 4 года назад
Really looking forward to your following videos on MVC. These inspired me a lot in learning Spring. Thanksssss
@SeleniumExpress
@SeleniumExpress 4 года назад
That's nice !! See you in the next video 😊
@santhoshchandran6952
@santhoshchandran6952 2 года назад
Need to watch again🙃
@sandhyavajrala7893
@sandhyavajrala7893 4 года назад
Hi Abhilash, Really these videos are very much helpful, this is first and ever great playlist about spring. I'm looking from many days for spring course, finally got perfect one..Tnq very much
@pradeep013
@pradeep013 4 года назад
Superb explanations.. it cleared all my doubts.. plz complete this series as soon as possible.. eagerly waiting for upcoming videos... Complete it fast...
@techent772
@techent772 4 года назад
Your video very helpful for mi and I will refer your video in our friend circle and those people are waiting your videos.
@SeleniumExpress
@SeleniumExpress 4 года назад
Thank you, Akshay 😊
@kodjovokou9352
@kodjovokou9352 4 года назад
Hello Boss, very very good explanations. I learn a lot, Thank you.
@shynggyskassen942
@shynggyskassen942 2 года назад
Great video. Thank you so much!
@avitech4444
@avitech4444 4 года назад
I am very enjoying at the learning video. you provide awesome and understandable concept . i am big fan of you. Thank you so much please provide Restful web services concept
@SeleniumExpress
@SeleniumExpress 4 года назад
I am glad that it helped 😊
@amansheikh1801
@amansheikh1801 Год назад
Thanks you.
@dilipsambare1450
@dilipsambare1450 4 года назад
Hi Abhilash, thank you for the well explanation. Waiting for your next video !
@SeleniumExpress
@SeleniumExpress 4 года назад
Thank You, Dilip.
@nmns.chaitanya1220
@nmns.chaitanya1220 4 года назад
Loved it!!
@SinghRahul-
@SinghRahul- 4 года назад
Wow amazing 😍👏 thanku
@SeleniumExpress
@SeleniumExpress 4 года назад
Thank you, Rahul.
@sharayuwankhade8464
@sharayuwankhade8464 3 года назад
Hi abhilash plzz make videos on web services.
@romi4386
@romi4386 2 года назад
great video! I have a question (sorry for my English) Im Spanish. so, why We need to use WebApplcationInicializer if I configure in properties and endpoint in Controller. ? I dont understand what is the different?
@karthikeyanv7236
@karthikeyanv7236 2 года назад
At 16:09 you are saying servlet context is interface the why you say servlet context object .how you can create object for interface????
@RanjithKumar-qj9mn
@RanjithKumar-qj9mn 2 года назад
AbstractAnnotationConfigDispatcherServletInitializer can i use this class instead of WebApplicationInitializer
@lifeisbeautiful230
@lifeisbeautiful230 3 года назад
Hi Abhilash a time 14:58, you are saying object of ServletContext is created however it is an interface. How it is please explain.
@musicbaba923
@musicbaba923 3 года назад
Hi abhilash we can also configure listener in web.xml file
@jaykishankeshri1516
@jaykishankeshri1516 4 года назад
When will you upload next video??
@SeleniumExpress
@SeleniumExpress 4 года назад
Hi Jaykishan, I will upload it in the next two days.
@jaykishankeshri1516
@jaykishankeshri1516 4 года назад
@@SeleniumExpress Thanks for the reply bro and I am eagerly waiting for the same.
@ravikumarkasula2810
@ravikumarkasula2810 4 года назад
Are you sriman student?
@yvonnegreen9336
@yvonnegreen9336 2 года назад
YOUNOT ALLOWEDONMY COMPUTER
@aks3911
@aks3911 Год назад
Q
@suhasdalvi3316
@suhasdalvi3316 2 года назад
Complete waste of time .if you want to learn thing of 10 mins in 2 hrs..your can follow this channel and videos
Далее
Нарвался на сотрудника ФСБ⚡️
01:00
What is JSON ?
11:56
Просмотров 1,1 млн
Spring Security Architecture Explained
14:41
Просмотров 105 тыс.