I am trying to get the id from the url, but it always empty.
@Path("/{id}")
@GET
@Produces({MediaType.TEXT_XML, MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
public Client returnXmlClient(@PathParam("id") String id)
{
logger.log(Level.SEVERE, "value of id is={0} ", id);
// ... other code
I am just starting to learn webServices,So please bare if it is something silly that i have Overlooked.
I had imported the Pathparam
from wrong package
import javax.websocket.server.PathParam;
it should have been
import javax.ws.rs.PathParam;
You are missing this annotation at method level @Consumes(MediaType.XXXXX)
Try to access your resource with correct uri
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With