From the course: Java EE 8 Essential Training
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Filters - Java EE Tutorial
From the course: Java EE 8 Essential Training
Filters
- [Narrator] Filters are another component found in the Servlet specification. Filters sit in front of Servlets to allow transformations to be applied to request and responses process by a Java EE application. This is beneficial when building an application that requires some logic to be applied to every request. Logging and security are very common use cases for filters. Let's take a look at how we can put a filter in place within our application. It's really simple. All we need to do is go to the com dot LinkedIn dot Servlet package. Right click, and then hover over new, and then go to other. Within the new dialogue, we can simply type filter, and that will narrow down the selection to the filter object. And just select that and hit next. And then here we can supply a name for our filter, which I'm going to name the Parameter Logging Filter. Once that name's in place, we can hit next. And then you'll notice that…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.