Take the 2-minute tour ×

I have mapped the database with JPA. I have a JSP file with form that is getting all the necessary data to create a new user in the database. A REST web service handling calls and a function to create new user looks like that:

public class CustomerRESTFacade {
    @Consumes({"application/xml", "application/json"})
    public Response create(Customer entity) {

How should I call the function POST? Now, I get all the data with first jsp file, I am forwarding to another jsp file, where I create a Customer and set all the fields. But how can I call this POST method? Or maybe I have to send somehow the Customer object to web service and then there add it to the database ? Thanks in advance for help.

share|improve this question
Since your resource accepts HTTP POST requests, you must make such a call to /entities.customer. It doesn't matter who makes this call as long as it contains XML or JSON that your JAX-RS implementation can map to a Customer instance. –  user647772 Aug 1 '12 at 8:53
how about adding a form to your jsp with action="/entities.customer" and method="post"? –  mfirry Aug 1 '12 at 9:04

Your Answer



Browse other questions tagged or ask your own question.