Play 2.0 framework - POST parameters

Posted by user1452715 on Stack Overflow See other posts from Stack Overflow or by user1452715
Published on 2012-06-13T03:46:12Z Indexed on 2012/06/13 4:40 UTC
Read the original article Hit count: 142

Filed under:
|

I'm trying to POST parameters to Action, and wrote in the routes:

Home page

GET / controllers.Application.index()

POST /login/name:/password: controllers.Application.login(name, password)

and I have an Action

public static Result login(String name, String password) {

  return ok(name + " "  + password);

}

my form is

<form action="/login" method="post">

    <input name="name" type="text" id="name">

    <input name="password" type="password" id="password">

    <input type="submit" value="Login">

</form>

and it doesn't work

For request 'POST /login' [Missing parameter: name]

what am i doing wrong?

© Stack Overflow or respective owner

Related posts about mvc

Related posts about playframework