filmov
tv
12 What Is the Use Of Servlet Context in Web.xml File
![preview_player](https://i.ytimg.com/vi/sCLRnmL3Wz4/maxresdefault.jpg)
Показать описание
ServletContext is created by the web container at time of deploying the project.
There is only one ServletContext object per web application.
Advantage of ServletContext
• Easy to maintain if any information is shared to all the servlet, it is better to make it available for all the servlet.
Usage of ServletContext
There can be a lot of usage of ServletContext object. Some of them are as follows:
1. The object of ServletContext provides an interface between the container and servlet.
4. The ServletContext object can be used to provide inter-application communication.
How to get the object of ServletContext interface
1. getServletContext() method of ServletConfig interface returns the object of ServletContext.
//We can get the ServletContext object from ServletConfig object
ServletContext context=getServletConfig().getServletContext();
2. getServletContext() method of GenericServlet class returns the object of ServletContext.
//Another way to get the ServletContext object
ServletContext application=getServletContext();
Material Source: Internet
There is only one ServletContext object per web application.
Advantage of ServletContext
• Easy to maintain if any information is shared to all the servlet, it is better to make it available for all the servlet.
Usage of ServletContext
There can be a lot of usage of ServletContext object. Some of them are as follows:
1. The object of ServletContext provides an interface between the container and servlet.
4. The ServletContext object can be used to provide inter-application communication.
How to get the object of ServletContext interface
1. getServletContext() method of ServletConfig interface returns the object of ServletContext.
//We can get the ServletContext object from ServletConfig object
ServletContext context=getServletConfig().getServletContext();
2. getServletContext() method of GenericServlet class returns the object of ServletContext.
//Another way to get the ServletContext object
ServletContext application=getServletContext();
Material Source: Internet
How To Use Your iPhone 12! (Complete Beginners Guide)
How To Use An Iphone 12-Full Tutorial
Why Does Music Only Use 12 Different Notes?
How to use a LCD Writing Tablet 12”
How to use the iPhone 12 Camera - Complete Beginners Guide
12 Privacy & Security Tools I Use EVERY DAY
🔥 ALL 12 Ways to use ‘WOULD’ correctly in English
Songs that use 12/8 time
TUDOR Tutorial #12: how to use the GMT function?
12 British words I now use everyday
How to use Urit 12 Hb meter | Accurex Biomedical
HiDow XPD 12 - How To Use
How to Use the Fuji Instax Mini 12 Camera
LP 1/12 DRY: How to use the double use brush?
How to use iPhone 12 (Pro) + Tips/Tricks!
How To Use The iPhone 12 & 12 Pro Camera Tutorial - New Tips, Tricks & Features
How To Use OnePlus 12! (Complete Beginners Guide)
HOW TO USE IPHONE 12 CAMERA?
12 Ways to Use Silence to Gain Respect and Attention
BlackJack 12 Ton Bottle Jack T91213W how to use the product
12 INSANE Use Cases for NEW ChatGPT o1 Model! (The BEST LLM)
How To SetUp & Use Volta Grip GoPro Hero 12
iPhone 12 Pro Beginner’s Guide How To Use
New to iPhone 12 mini - How to Use iPhone 12 mini 64gb, 128gb, 256gb - Beginners Manual Guide
Комментарии