JAX-RS (REST)No Comments

In JAX-RS, you can use @PathParam to inject the value of URI parameter that defined in @Path expression, into Java method.

  • @PathParam – Single Parameter

A simple and normal way to use @PathParam.

In above example, the value of {id} from “/users/{id}” will match to “@PathParam(“id”) String var“.

URI Pattern : “/users/22667788

  • @PathParam – Multiple Parameters

Example to inject multiple parameters into Java method.

URI Pattern : “/users/2011/06/30


Be the first to post a comment.

Add a comment


Warning: stream_socket_client(): unable to connect to http://browscap.org/version (Unable to find the socket transport "http" - did you forget to enable it when you configured PHP?) in /home/javasail/public_html/wp-content/plugins/wp-statistics/vendor/browscap/browscap-php/src/phpbrowscap/Browscap.php on line 1366

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /home/javasail/public_html/wp-content/plugins/wp-statistics/vendor/browscap/browscap-php/src/phpbrowscap/Browscap.php on line 1004