From the course: Jakarta EE Servlets

Unlock the full course today

Join today to access over 23,100 courses taught by industry experts.

Advanced request-handling techniques

Advanced request-handling techniques - Jakarta EE Tutorial

From the course: Jakarta EE Servlets

Advanced request-handling techniques

- [Instructor] Servlet containers provide some additional capabilities beyond those that we've seen for basic request handling. These more advanced capabilities are useful when there's common logic or cross-cutting concerns that need to be performed across many of the servlets in a web-based system. So think about something like error handling that should be performed consistently across a set of servlets, or maybe there's some logic that must be performed for every request the system receives. For these types of situations, there are some other components defined in the servlets specification that we can use. So let's say that we need to perform some common logic across a group of servlets within our system. We can use a filter for that. Filters allow logic to be introduced before a request is processed and before a response is returned to the client. The request dispatcher is another tool that we can leverage. It…

Contents