users@jersey.java.net

Re: [Jersey] Problem with PUT method.

From: Patrick Dreyer <Patrick_at_Dreyer.name>
Date: Wed, 04 Aug 2010 07:34:17 +0200

  It's all about a missing slash:

Wrong: @Path("{eventType}")
Correct: @Path("/{eventType}")

Patrick

Am 03.08.2010 18:37, schrieb Lakkaraju Krishna:
>
> Hi,
>
> I am trying to write a @PUT method using Jersey and upon starting the server, the server is not recognizing the PUT operation.
>
> The sample PUT method:
>
> @Path("/event")
>
> *public* *class* EventRestService{
>
> @PUT
>
> @Path("{eventType}")
>
> @Consumes(MediaType./TEXT_PLAIN/)
>
> *public* Response updateEventLog(@PathParam("{eventType}") String eventType){
>
> //List<Event> eventLst;
>
> System./out/.println(eventType +" ========> from Server.");
>
> *return* *null*;
>
> }
>
> }
>
> URL: http:/localhost/rest/event/123
>
> I am getting 405 exception, why? Am I doing anything wrong here !
>
> - Lakkaraju
>
> This e-mail message may contain confidential and/or privileged information. If you are
> not an addressee or otherwise authorized to receive this message, you should not use,
> copy, disclose or take any action based on this e-mail or any information contained in the
> message. If you have received this material in error, please advise the sender immediately
> by reply e-mail and delete this message.
>
> Thank you.