JSP filter yog dab tsi?
JSP filter yog dab tsi?

Video: JSP filter yog dab tsi?

Video: JSP filter yog dab tsi?
Video: JSP Force8 reusable mask: Changing Filters 2024, Kaum ib hlis
Anonim

JSP Cov lim dej yog cov chav kawm Java uas tuaj yeem siv los cuam tshuam kev thov los ntawm tus neeg siv khoom lossis tswj cov lus teb los ntawm server. Cov lim dej tuaj yeem siv los ua Authentication, Encryption, Logging, Auditing. A lim yog Java chav kawm uas siv javax. servlet. Lim interface.

Tom qab ntawd, ib tug kuj yuav nug, dab tsi yog lub lim hauv Java?

javax.servlet pej xeem interface Lim . A lim yog ib yam khoom uas ua lim kev ua haujlwm ntawm ob qho kev thov rau cov peev txheej (servlet lossis cov ntsiab lus zoo li qub), lossis ntawm cov lus teb los ntawm cov peev txheej, lossis ob qho tib si. Cov lim ua haujlwm lim hauv txoj kev doFilter.

Ib sab saum toj no, dab tsi yog chav lim dej? A lim yog Java chav kawm uas yog invoked nyob rau hauv teb rau kev thov rau ib tug kev pab cuam nyob rau hauv ib tug Web daim ntawv thov. Cov peev txheej suav nrog Java Servlets, JavaServer nplooj ntawv (JSP), thiab cov peev txheej zoo li qub xws li nplooj ntawv HTML lossis cov duab. Hauv qee qhov xwm txheej, siv lim tuaj yeem ntxiv qhov tsis tsim nyog rau kev thov thiab txo qis kev ua haujlwm.

Tom qab ntawd, ib tus tuaj yeem nug, dab tsi yog servlet lim thiab nws ua haujlwm li cas?

Servlet Lim . A lim yog ib yam khoom uas tau hais los ntawm preprocessing thiab postprocessing ntawm qhov kev thov. Nws yog tsuas yog siv los ua lim cov dej num xws li hloov dua siab tshiab, txiav, compression, encryption thiab decryption, input validation thiab lwm yam. servlet lim yog pluggable, piv txwv li nws nkag tau txhais hauv lub vev xaib.

Koj tsim cov lim hauv Java li cas?

Yeej, muaj 3 kauj ruam mus tsim lub lim : - Sau ib Java chav kawm uas siv cov Lim interface thiab override lim cov txoj kev ua neej nyob. - Qhia qhov pib tsis ua haujlwm rau cov lim (yeem). - Qhia lim map, ib Java servlets lossis URL qauv.

Pom zoo: