users@jersey.java.net

[Jersey] Two POSTs for a single URI

From: Arthur Yeo <artyyeo_at_gmail.com>
Date: Tue, 4 Oct 2011 10:17:35 -0700

All,

Is it possible for two separate POSTs to be supported under a single URI?

For e.g.
I have a URI ... say ... /newAccount

And, my Jersey code looks like this ...

@Stateless
@Path("/ca")
public class ConsumerAccountRsrc {

   @POST
   @Consumes("application/x-www-form-urlencoded")
   @Produces("text/html")
   public String createNewAcc(
                                @FormParam("email") String emailAddr,
                                @FormParam("atype") String AccType)
   {
             ...
   }


   @POST
   @Consumes("application/x-www-form-urlencoded")
   @Produces("text/html")
   public String createNewAcc(
                                @FormParam("email") String emailAddr,
                                @FormParam("atype") String AccType,
                                @FormParam("somethingDifferent") String blah
)
   {
             ...
   }

}


It seemed to compile but ...


-- 
Arthur Y.
*Don't ever forget Sept. 11 !!!*