Package models

Examples of models.Person


        }
        renderText(p.x + "|" + p.y);
    }

    public static void signin(@As("secure") Person person) {
        Person verifyPerson = get();
        flash.clear();
        if (verifyPerson.userName.equals(person.userName) && verifyPerson.password.equals(person.password)) {
           flash.success("Authentication successful!");
        } else {
           flash.error("Authentication failed!");
View Full Code Here


        }
        render("/DataBinding/signinPage.html", person);
    }

    static Person get() {
        Person person = new Person();
        person.userName = "nicolas";
        person.password = "nicolas";
        return person;
    }
View Full Code Here

        }
        renderText(p.x + "|" + p.y);
    }

    public static void signin(@As("secure") Person person) {
        Person verifyPerson = get();
        flash.clear();
        if (verifyPerson.userName.equals(person.userName) && verifyPerson.password.equals(person.password)) {
           flash.success("Authentication successful!");
        } else {
           flash.error("Authentication failed!");
View Full Code Here

        }
        render("/DataBinding/signinPage.html", person);
    }

    static Person get() {
        Person person = new Person();
        person.userName = "nicolas";
        person.password = "nicolas";
        return person;
    }
View Full Code Here

public class PersonControllerTest extends NinjaTest {
   
    @Test
    public void testPostPersonJson() throws Exception {
        Person person = new Person();
        person.name = "zeeess name - and some utf8 => öäü";

        String response = ninjaTestBrowser.postJson(getServerAddress()
                + "api/person.json", person);

        Person result = new ObjectMapper().readValue(response, Person.class);
        assertEquals(person.name, result.name);
    }
View Full Code Here

        assertEquals(person.name, result.name);
    }
   
    @Test
    public void testPostPersonXml() throws Exception {
        Person person = new Person();
        person.name = "zeeess name - and some utf8 => öäü";

        String response = ninjaTestBrowser
                .postXml(getServerAddress() + "api/person.xml", person);
       
        System.out.println("j: " + response);


        Person result = new XmlMapper().readValue(response, Person.class);
        assertEquals(person.name, result.name);
    }
View Full Code Here

public class PersonController {

    public Result getPersonJson() {

        // simply render a json as result:
        Person person = new Person();
        person.name = "zeeess name - and some utf8 => öäü";

        // render
        return Results.json().render(person);
    }
View Full Code Here

    }
   
    public Result getPersonXml() {

        // simply render a json as result:
        Person person = new Person();
        person.name = "zeeess name - and some utf8 => öäü";

        // render
        return Results.xml().render(person);
    }
View Full Code Here

        // usually we would save something into a db or so..
        return Results.xml().render(person);
    }
   
    public Result getPersonViaContentNegotiation() {
        Person person = new Person();
        person.name = "zeeess name - and some utf8 => öäü";
       
        return Results.ok().render(person);
    }
View Full Code Here

       
        return Results.ok().render(person);
    }
   
    public Result getPersonViaContentNegotiationAndFallback() {
        Person person = new Person();
        person.name = "zeeess name - and some utf8 => öäü";
       
        return Results
                .ok()
                .supportedContentTypes(Result.TEXT_HTML, Result.APPLICATON_JSON)
View Full Code Here

TOP

Related Classes of models.Person

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.