Advertisement
Shishire

JAX-RS not finding subresource locator

Mar 31st, 2013
280
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.62 KB | None | 0 0
  1. @Path("/event/{eventId: [0-9]+}")
  2. public class EventAPI
  3. {
  4.     protected EventDescriptor dummyEvent = new EventDescriptor();
  5.    
  6.     @GET
  7.     @Produces({"application/json", "text/xml"})
  8.     public EventDescriptor getEvent(@PathParam("eventId") Integer eventId)
  9.     {
  10.         return this.dummyEvent;
  11.     }
  12. }
  13.  
  14. public class EventDescriptor
  15. {
  16.     protected Stuff stuffs = new Stuff();
  17.     {
  18.         // populate with participants
  19.     }
  20.    
  21.     @GET
  22.     @Produces({"application/json", "text/xml"})
  23.     @Path("/{participantId}")
  24.     public Stuff getStuffForParticipant(@PathParam("participantId") String participantId)
  25.     {
  26.         return this.stuffs.get(participantId);
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement