Why should we have a listener?
A listener is a Java class used to handle a series of events that can be configured in a Java Web project.
So why not call the listener directly with code?
This may be due to the project engineering standards stipulated in the Java EE specification, using Web. XML to designate listeners,
The server middleware, such as WebLogic, can then read Web. xml as standard, running the listener to handle the specified event.
In this way, Listener,servlet is a similar norm.
Why should I have web. xml?
Web. XML makes it easy (and perhaps not) to modify the listener used in the project.
Does this kind of thing look like a trigger or a polling process? If it's like, what's the difference between it and a trigger?
like. The listener is the listener listener event occurs or not, if the event will send a signal to the listener, the listener is actually the design pattern of the observer pattern embodiment, but still have a description of the difference.
The listener is a message that listener a receives the event source S, and the event is two separate from the message; And the Observer observer the message and the event is one, the difference is that when inheriting Java code
Changes in different ways.
The triggers in the database are somewhat like this, but they are not generally compared.
Similar to the Django views.py, how does the Web. XML modify the code so that it can map URLs to the actual file address?
<servlet><servlet-name><servlet-mapping> by label;:
Set Jsp-file-servlet-name, Url-pattern- servlet-name, to get Url-pattern to jsp-file mappings.
I want to change the Web. XML, where is Web. XML placed?
generally under the web-inf of the engineering catalogue.
"Java Core technology" listener in Java Web