Package controllers

Source Code of controllers.Errors

package controllers;

import models.ErrorModel;
import yalp.data.validation.Valid;
import yalp.mvc.Controller;

public class Errors extends Controller {

    public static void index() {
        ErrorModel model = new ErrorModel();
        model.getMember().setName(flash.get("model.member.name"));
        render("Application/errors.html", model);
    }

    public static void submit(@Valid ErrorModel model) {
        if (validation.hasErrors()) {
            params.flash();
            index();
        } else {
            renderText("it works now: " + model.getMember().getName());
        }
    }  
}
TOP

Related Classes of controllers.Errors

TOP
Copyright © 2018 www.massapi.com. 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.