0

I have a embedded Jetty server(currently using 8.1.16) where I'm deploying multiple resources whose resource path is as below :

1) /users (path spec : /users) 2)/users/{id} (path spec : /users/*)

The context path is set as (/). If I add the servlet for the wildcard first (i.e /users/*) and then /users everything seems to work fine. I can access the resources successfully at /users and /users/<>.

However if the order in which the servlets are added to the ServletContextHandler is reversed, I can only access the path with wildcard (i.e /users/*) and I get 404 on /users. Is this expected? How can I access both the resources even when the order is reversed? Has anyone ever come across such issue?

Thanks in advance.

Joakim Erdfelt
  • 46,896
  • 7
  • 86
  • 136
  • [Jetty 8.x is EOL (End of Life)](https://www.eclipse.org/lists/jetty-announce/msg00069.html), consider using a supported and stable version of Jetty. The Jetty 9.4.x series has reworked path mappings significantly (you can even use regex and uri-template based path mappings in embedded-jetty) – Joakim Erdfelt Oct 22 '18 at 22:04
  • Thanks for the suggestion. Yes, it does work with 9.4.x series :) – ProgramNerd Dec 13 '18 at 22:05

0 Answers0