Created
October 6, 2010 20:26
-
-
Save mmurray/614014 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| // Application.java | |
| public class Application extends Controller { | |
| protected static void respondWith(Object... args){ | |
| try { | |
| render(args); | |
| }catch(TemplateNotFoundException e) { | |
| if(request.format == "json") { | |
| renderJSON(args); | |
| } | |
| } | |
| } | |
| public static void index() { | |
| render(); | |
| } | |
| } | |
| // Articles.java | |
| public class Articles extends Application { | |
| public static void index() { | |
| render(); | |
| } | |
| public static void create() { | |
| } | |
| public static void save() { | |
| String hello = "world"; | |
| respondWith(hello); | |
| } | |
| public static void update() { | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment