---
title: "Servlet url-pattern规则"
author: "ghsea"
date: "2008-04-10T22:33:31Z"
tags: ["JSP", "Servlet"]
slug: "servlet-url-pattern"
draft: true
lastmod: "2008-04-10T22:33:31Z"
id: 181485
url: "https://ghsea.iteye.com/blog/181485"
---

\* Exact match (/foo)绝对匹配  
\* Path match (/foo/\*)部分匹配  
\* Extension match (\*.foo)后缀匹配  
\* Default servlet (/) which is useful only for servlet mappings

There is no legal syntax to say "all but this set of paths".

如果pattern写成/foo/或者 /\*.jsp或者\*/foo等等都是无效的url-pattern