JAX-RS (REST)No Comments

In JAX-RS, you can use @FormParam annotation to bind HTML form parameters value to a Java method. The following example show you how to do it :

1. HTML Form

See a simple HTML form with “post” method.

  • @FormParam Example

Example to use @FormParam to get above HTML form parameter values.

  • Demo

Access HTML Page. URL : http://localhost:8080/RESTfulExample/UserForm.html

When “add user” button is clicked, it will redirect to URL : http://localhost:8080/RESTfulExample/rest/user/add

and display the following output :

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 769