users@jersey.java.net

enforce trailing slashes

From: Christian Helmbold <christian.helmbold_at_yahoo.de>
Date: Fri, 12 Nov 2010 11:07:11 +0000 (GMT)

Hi,

I have "directory resources" which should (and have to!) end with a trailing
slash, because I use templates with relative links, which wouldn't work without
the trailing slash.

Example:

  Template: <a href="sub">sub</a>

  Wrong:
  URI: http://example.com/directory
  Link in template leads to: http://example.com/sub

  Correct:
  URI: http://example.com/directory/
  Link in template leads to: http://example.com/directory/sub

I use @Path("directory/") with a trailing slash, but it is ignored by Jersey
(what may be fine in many cases). Is there an easy way to enforce the trailing
slash?

Regards
Christian

 --
http://scala-forum.org/