Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Introduction of three commonly used components of Java

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article introduces the knowledge of "introduction of the three commonly used components of Java". Many people will encounter such a dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

I. Servlet

Servlet is a dynamic resource used to process client requests, that is, when we type an address into the browser and enter to jump, the request will be sent to the corresponding Servlet for processing.

The specific processing process:

1. Receive request data: we all know that client requests are encapsulated into HttpServletRequest objects that contain request headers, parameters, and other information.

two。 Processing requests: usually we receive parameters in the service, doPost, or doGet methods and call the business layer (service) method to process the request

3. Response: after processing the request, we usually forward (forward) or redirect (redirect) to a page. Forwarding is a method in HttpServletRequest and redirection is a method in HttpServletResponse. There is a big difference between the two.

Filter (filter): similar to Servlet, it is used to intercept or release requests. (there are four ways to intercept (unfamiliar)) there are three ways to match:

Exact match, such as / foo.htm, will only match the URL of foo.htm

Path matching-for example, / foo/*, matches URL prefixed with foo

Suffix matching, such as * .htm, matches all UR with the suffix .htm

three。 Listener (listener): add a listener to the button. When you click this button, you will trigger a listening event and call the onClick method, which is essentially a method callback.

This is the end of the introduction of the three commonly used components of Java. Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report