"Java Core technology" listener in Java Web

Source: Internet
Author: User
Tags java web

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.