Sunday 15 May 2011

java - RestEasy @ApplicationPath using a pattern -


I am trying to use RestEasy and Jax-Rs for routes for proper resources in the Java application. However, I'm having trouble using @App Application Annotation I want to pass in a pattern and this is the proper way to match that place

I have tried to do this :

  @ApplicationPath ("* / rest / v1 /") ...   

And I can make a way to the path like this: / P>

  / my ablation / rest / v1 /   

or

  / other app / left / v1 /   

On the same application.

However, RestEasy gives me a 404 can not match this resource, but if I do * without having to hardcode the path / it works fine it is possible to put a pattern in the @ apps path ?

Edit:

Its entire purpose is to configure the root path of the application to be configurable and run by it, but if a filter is configured to run the @AppTransition path on runtime Perhaps there is a way that would be a better solution

@applicationpath Only the RestEasyActivator is done for the class.

Use the path for Now, when it is cleared, read it:

@ path Annotation Simple path expressions Not limited to. You also have the ability to put regular expressions in the path of @ path. For example: @ path ("/ resource) public class MyResource {@GET @Path (" {var :.} / stuff ") public string received () {...}}

The following GETs will route the getResource () method:

  received / resources / stuff     
  path ("/ resource / {var}", for example: ([] *) "expression of default"  

Stuff ")

This will match:

  received / resource / Foo / stuff received / resource / bar / stuff <    / Pre> 

link:

No comments:

Post a Comment