title: Optional @PathParam in Jax-RS
body: <p>I have a service where the last part of the path is optional, the user can both enter <strong>/mypath/</strong> and <strong>/mypath/param1/</strong>.</p>
  
  <p>I tried to use a regular expression to filter the last part of the path:</p>
  
  <p><code>@Path("/mypath{param1: (/param1)?}")</code></p>
  
  <p>I'm using RestEasy as my JAX-RS provider and the code works as expected in Tomcat but when I deploy it in JBoss I get a 405 return code when I do not submit the optional part.</p>
  
  <p>Am I doing something wrong here or it's not possible to accomplish this in a portable way?</p>