users@jersey.java.net

Re: [Jersey] Simple _at_Path question

From: Imran M Yousuf <imran_at_smartitengineering.com>
Date: Wed, 31 Mar 2010 06:31:56 +0600

Hi Gregg,

Following is how I got it to work:

  private static final String ALL_PATTERN_STR =

"([a-zA-Z0-9_]+)(-[a-z]+)?(\\+[a-z]+)?(\\.[a-z]+)";
  @Path("{exchangeSpec: " + ALL_PATTERN_STR + "}")
  //Example: dse_bd-en+mini.json, dse_bd-en.json, dse_bd.rss

Jersey version - 1.1.5

Best regards,

Imran

On Wed, Mar 31, 2010 at 3:58 AM, Gregg Carrier <greggcarrier_at_gmail.com> wrote:
> I'm trying to match
> /queries
> AND
> /queries.json
>
> This is my @Path:
> @Path("{dummy:/queries(\\.json)?}")
>
> Seems like a simple enough regex - can't get Jersey to do the right thing.
>
> Thanks!
>
> Gregg
>



-- 
Imran M Yousuf
Entrepreneur & CEO
Smart IT Engineering
Dhaka, Bangladesh
Email: imran_at_smartitengineering.com
Blog: http://imyousuf-tech.blogs.smartitengineering.com/
Mobile: +880-1711402557