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

53 Servlet Life Cycle Event | |Adv Java Servlet Programming Tutorial | adv java servlet tutorial смотреть онлайн

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

#Servlet #Life #Cycle #Event: #adv java #Advance #Java #Servlet #Programming #Tutorial
- Event means an action raised on component or object is called as "event".
- Executing some logic when event is raised is called "event handling".
- In the life cycle of human being(birth to death) the following life cycle event takes place:
- Birth event.
- Naming event.
- Going to School.
- Completing studies event.
- Marriage event.
- Death event.
- In the life cycle of servlet program (our servlet class object creation to the destruction) the servlet container raises the following event.
1) Instantiation event: (Raises when ServletContainer creates our servlet class object).
2) RequestArrival Event: (Raises when our servlet program gets requested from clients/browser window)
3) Destruction Event: (Raises when servlet container is about to destroy our servlet class object)
- Servlet container automatically calls 3 life cycle methods when these 3 life cycle events are raised on servlet class object they are:
1) public void init(ServletConfig cfg)throws ServletException
Servlet container calls this method for instantiation event.
2) public void service(ServletRequest req, ServletResponse res)throws ServletException, IOException
Servlet container calls this method for request arrival event.
3) public void destroy()
Servlet container calls this method for destruction event.
- The above 3 methods that are called by underlaying container automatically based on the events that(instatiation, request-arrivale,destriction events) are raised are called as "life-cycle methods" or "container callback methods".
- Does Not Exist State: Means our servlet class object is not created.
- Ready State: Means our servlet calss object is ready to process the request.
Note: Programmer never calls the life cycle method of servlet program manually, but these methods will be called by servlet container automatically based on the events that are raised.
-- There are two init() methods:
--------------------------------
1) public void init(ServletConfig cfg)throws ServletException
This method is servlet life cycle method.
2) public void init()
Its not the life cycle method.
-- There are two service(-,-) methods & 7 doXxx(-,-) methods in servlet API:
Two Service(-,-) methods:
1) public void service(ServletRequest req, ServletResponse res)throws ServletException, IOException
This method is life cycle method.
2) protected void service(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
Its not a life cycle method.
- Seven doXxx(-,-) methods:
1) protected void doGet(HttpServletRequest req, HttpServletResponse res)throws ServletException, IOException
2)) protected void doPost(HttpServletRequest req, HttpServletResponse res)throws ServletException, IOException
3) protected void doHead(HttpServletRequest req, HttpServletResponse res)throws ServletException, IOException
4) protected void doDelete(HttpServletRequest req, HttpServletResponse res)throws ServletException, IOException
5) protected void doTrace(HttpServletRequest req, HttpServletResponse res)throws ServletException, IOException
6) protected void doOptions(HttpServletRequest req, HttpServletResponse res)throws ServletException, IOException
7) protected void doPut(HttpServletRequest req, HttpServletResponse res)throws ServletException, IOException
- ServletConfig object is one per servlet class object, acting as right hand object to our servlet class object. We can use this object to gather information about servlet program and to pass additional information/details to servlet program.
- Servlet container creates ServeltConfig object right after creating our servlet class object.
- ServletConfig object means its the object of a servlet container supplied java class that implements javax.servlet.ServletConfig interface.
- Life cycle methods of servlet program are useful for programmer in two ways:
1) To place programmer choice logic for life cycle events towards generating webpages.
2) To receive & use container supplied objects in servlet programming (request, reponse object comes to our servlet program as the parameter of service method).
- Programmer overrides 3 life-cycle methods in his servlet program & places important logics:

1) init(ServletConfig cfg):
Its one time execution block of servlet program lifecycle.
Servlet container calls this method for instantiation event.
This method is good to place initialization logics like creating JDBC connection object.

Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «53 Servlet Life Cycle Event | |Adv Java Servlet Programming Tutorial | adv java servlet tutorial» бесплатно и без регистрации, вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.

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

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

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