Deployment Structure of a Web-Server
Though it varies a lot from Server to Server, some of the components are very common.
Elements of web.xml
Filters are used in web application to pre-process request and post-process response before/after passing control to the servlet.
This is helpful when its not possible to change the servelt itself but as expected, it degrades the performance of the entire system. However, it can be used for:
Filters can be used by doing the following:
<filter> <filter-name>myFilter</filter-name> <filter-class>examples.myFilterClass</filter-class> <init-param> <param-name>myInitParam</param-name> <param-value>myInitParamValue</param-value> </init-param> </filter> <filter-mapping> <filter-name>myFilter</filter-name> <url-pattern>/myPattern/*</url-pattern> </filter-mapping>
These are event listener classes which can be added for listening to events like:
Listeners are implemented by doing the following:
Java checks the type of listener-interface implemented by each class and calls the appropriate listener for different events.
More than one listener can be registered for one event.
|Email:||(Your email is not shared with anybody)|