Play framework 2.2 Form http get

Hello I am absolutely newbie in this framework.So I have webservice where I have api and database.So I should send get request like then it will give anwser in json like status:true it means I have registered.I have tried but unsuccessfully:Even I dont know steps to do it

<!DOCTYPE html>

        <meta charset="utf-8">
        <link rel="stylesheet" media="screen" href=""stylesheets/stylelogin.css")">

        <meta name="viewport" content="width=device-width, initial-scale=1">
        <script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
        <link href=',400,300,600,700' rel='stylesheet' type='text/css'>
        <div class="main">
            <div class="login-form">
                <h1>Member Login</h1>
                <div class="head">
                    <img src=""images/user.png")" alt=""/>

                    <input type="text" class="text" value="USERNAME" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'USERNAME';}" >
                    <input type="password" value="Password" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Password';}">
                    <div class="submit">
                        <input type="submit" onclick="@controllers.Login.index()" value="LOGIN" >




GET /login controllers.Signup.login()

package controllers;

import play.mvc.Controller;
import play.mvc.Result;
import views.html.login;

public class Signup extends Controller {

    public static Result login() {
        return ok(

public static Promise<Result> index() {
final Promise<Result> resultPromise = WS.url(feedUrl).get().flatMap(
        new Function<WS.Response, Promise<Result>>() {
            public Promise<Result> apply(WS.Response response) {
                return WS.url(response.asJson().findPath("status").asText()).get().map(
                        new Function<WS.Response, Result>() {
                            public Result apply(WS.Response response) {
                                return ok("Number of comments: " + response.asJson().findPath("count").asInt());
return resultPromise;


        public static class Login {

            public String email;
            public String password;


String name;
String pass
How to sent get request like
Where name and pass comes from form and send request if no error parse json

Source: json

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.