From the course: Jakarta EE Servlets

Unlock the full course today

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

Advanced Servlet mappings

Advanced Servlet mappings - Jakarta EE Tutorial

From the course: Jakarta EE Servlets

Advanced Servlet mappings

- [Instructor] In some systems you'll need to create multiple servlets which can make establishing the mappings for those servlets a little more involved. In this lesson, we'll learn about some different strategies for mapping servlets that you can use in these situations. So let's imagine that we need to create another servlet within our H Plus sport catalog project that's going to handle the logic for retrieving or updating a single product. So to get started, let's create our new servlet by just copying our existing product servlet. Now we'll have to give this servlet a new name. So here I'm just going to take the S off of products to indicate we're working with a single product. All right. Let's go ahead, we'll create that servlet and then we can open it up. And here we're going to use a different type of URL pattern for our server mapping. This is going to be a path mapping. And what we do with a path mapping…

Contents