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