RUVIDEO
Поделитесь видео 🙏

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

📁 Обучение 👁️ 17 📅 05.12.2023

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 [email protected]

you can ping me on my Facebook page.

https://www.facebook.com/seleniumexpress

Make sure to join my private Facebook page.

“SeleniumExpress - Support"

you can ask for support in my website forum.

https://www.seleniumexpress.com

Subscribe to my youtube channel.

https://www.youtube.com/channel/UCpUYkSDJpHug-vfC5S-NXRA?sub_confirmation=1

Music :

-----------

credits : -

(intro)

Adventures by A Himitsu https://soundcloud.com/a-himitsu

Creative Commons — Attribution 3.0 Unported— CC BY 3.0

http://creativecommons.org/licenses/b...

Music released by Argofox https://youtu.be/8BXNwnxaVQE

Music provided by Audio Library https://youtu.be/MkNeIUgNPQ8



intro template :
www.youtube.com/Alexbau01

Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «NO WEB.XML ? || Spring MVC Java based configuration || WebApplicationInitializer || Part 2», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.

Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.

Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!

Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.