users@jersey.java.net

[Jersey] Re: POSTing to Jersey using JQuery

From: Martin Matula <martin.matula_at_oracle.com>
Date: Tue, 01 Nov 2011 14:52:08 +0100

Can you send the whole exception stack trace and the exact exception
message? How does the path template for your resource look like? The
code you have below would not compile, as the HeyStaksLogin does not
return viewable - can you post the real code?

On 31.10.2011 11:15, Aidan C wrote:
> I'm attempting to POST data Jersey using the following..
>
>
> the POST being made
>
> var details = {'username': username, 'password': password};
> $.POST('login', details,function(result){
> console.log(result);
> },"json");
>
> The receiving method
>
> @POST
> public Viewable HeyStaksLogin(LoginInfo loginI){
> String uname = loginI.username;
> String pword = loginI.password;
> System.out.println("username = ");
> }
>
> The loginInfo class
>
> @XmlRootElement
> public class LoginInfo {
> public String username;
> public String password;
> }
>
> however, I'm getting a TypeError saying undefined method back. Why is
> this happening? How can I POST my data using JQuery?