Created
December 11, 2014 16:27
-
-
Save chkal/659854a1a99d1ea4afb3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Controller | |
@Path("/somepage") | |
public class SomeController { | |
@Inject | |
private Result result; | |
@Inject | |
private Validator validation; | |
@Get | |
public void renderPage() { | |
result.include("foo", "Something to include on the page"); | |
result.include("bar", "More stuff to include on the page"); | |
} | |
@Post | |
public void processForm(@NotNull @Valid Form form) { | |
validation.onErrorForwardTo(this).renderPage(); | |
// validation has passed, perform business logic here | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment