I am not using JSON or anything like that. I have a simple form to upload a file and I want to read the parameters of the form. The code below is not working as expected.
If you are using Jersey RESTful API in JAVA you can look for Parameter Annotations (@*Param)
Example:
Dependency:
com.sun.jersey
jersey-client
1.8
Code:
package yourpack;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.core.Response;
@Path("/path_to_data")
public class DataResource {
@GET
@Path("/{param}")
public Response getMsg(@PathParam("param") String urlparam) {
int ok = 200;
String result = "Jersey Data resource: " + urlparam;
return Response.status(ok).entity(result ).build();
}
}
List of annotations: @MatrixParam, @HeaderParam, @CookieParam, @FormParam, @QueryParam, @PathParam