JAX-RS @POST does not return String
<p>I am trying to write @POST sync method which will take in 2 String parameters. When I access the 2 links from the browser, I did not get the return String "SUCCESS!". It seems the methods doesn't get called at all? </p>

<p><a href="http://localhost:9080/SampleWeb/resources/helloworld/sync?param1=string1&amp;param2=string2" rel="nofollow">http://localhost:9080/SampleWeb/resources/helloworld/sync?param1=string1&amp;param2=string2</a></p>

<p><a href="http://localhost:9080/SampleWeb/resources/helloworld/sync/string1/string2" rel="nofollow">http://localhost:9080/SampleWeb/resources/helloworld/sync/string1/string2</a></p>

<pre><code>@Path("/helloworld")
public class HelloWorldResource {   

    @POST
    @Produces("text/plain")
    @Path("/sync")
    public String sync(
            @QueryParam("param1") String param1,
            @QueryParam("param2") String param2) {

        //do something

        return "SUCCESS!";
    }

    @POST
    @Produces("text/plain")
    @Path("/sync/{param1}/{param2}")
    public String sync(
            @PathParam("param1") String param1,
            @PathParam("param2") String param2) {

        //do something

        return "SUCCESS!";
    }
}   
</code></pre>