开发者

How do I bind a servlet to everything except /?

I have a server which I need to bind two servlets to.

The first is the "home" servlet, which I want to reside at /. This will display what is essentially a welcome page.

The second is a servlet which will serve content based on a url-shortener style link code. This needs to bind to any other request.

M开发者_Python百科y problem is that if I bind the second servlet to /* then this also includes /


Exact mapping has a bigger priority that path mapping. So you shouldn't have any problem if you map your home servlet to / and the other one to /*, because / will take the precedence over /*.


  1. Map specific servlet to "/index"
  2. Map generic servlet to "/*"
  3. Add welcome-file "index" in the welcome-file-list
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜