<pre><code>&lt;servlet&gt;
    &lt;servlet-name&gt;myservlet&lt;/servlet-name&gt;
    &lt;servlet-class&gt;workflow.WDispatcher&lt;/servlet-class&gt;
    &lt;load-on-startup&gt;2&lt;/load-on-startup&gt;
&lt;/servlet&gt;

&lt;servlet-mapping&gt;
    &lt;servlet-name&gt;myservlet&lt;/servlet-name&gt;
    &lt;url-pattern&gt;*NEXTEVENT*&lt;/url-pattern&gt;
&lt;/servlet-mapping&gt;
</code></pre>

<p>Above is the snippet from Tomcat's <code>web.xml</code>. The URL pattern <code>*NEXTEVENT*</code> on start up throws</p>

<blockquote>
  <p>java.lang.IllegalArgumentException: Invalid &lt;url-pattern> in servlet mapping</p>
</blockquote>

<p>It will be greatly appreciated if someone can hint at the error.
­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­</p>

[{'answer_id': 26744, 'author': 'McDowell', 'author_id': 304, 'author_profile': 'https://Stackoverflow.com/users/304', 'pm_score': 8, 'selected': True, 'text': '<pre><code>&lt;url-pattern&gt;*NEXTEVENT*&lt;/url-pattern&gt;\n</code></pre>\n\n<p>The URL pattern is not valid. It can either end in an asterisk or start with one (to denote a file extension mapping).</p>\n\n<p>The url-pattern specification:</p>\n\n<blockquote>\n  <ul>\n  <li>A string beginning with a ‘/’ character and ending with a ‘/*’\n  suffix is used for path mapping.</li>\n  <li>A string beginning with a ‘*.’ prefix is used as an extension\n  mapping.</li>\n  <li>A string containing only the ’/’ character indicates the "default"\n  servlet of the application. In this\n  case the servlet path is the request\n  URI minus the context path and the\n  path info is null.</li>\n  <li>All other strings are used for exact matches only.</li>\n  </ul>\n</blockquote>\n\n<p>See section 12.2 of the <a href="https://jcp.org/aboutJava/communityprocess/final/jsr340/index.html" rel="noreferrer">Java Servlet Specification</a> Version 3.1 for more details.</p>\n'}, {'answer_id': 61951, 'author': 'talg', 'author_id': 3332, 'author_profile': 'https://Stackoverflow.com/users/3332', 'pm_score': 1, 'selected': False, 'text': '<p>A workaround that can achieve that is to add a servlet filter to do URL re-writes e.g.\nre-write <em>NEXTEVENT</em> to /NEXTEVENT/<em>(the one before the NEXTEVENT)/</em>(the one after NEXTEVENT) or something similar.</p>\n'}]
['https://Stackoverflow.com/questions/26732', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/']