Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Application extends Controller {
- public static class Result {
- public Result(String contents, Status status) {
- this.contents = contents;
- this.status = status;
- }
- public final String contents;
- public final Status status;
- // "status":{"url":"https://mtgox.com/api/0/data/ticker.php","content_type":"application/json","http_code":200
- public static class Status {
- public final String url;
- public final String content_type;
- public final int http_code;
- public Status(String url, String content_type, int http_code) {
- this.url = url;
- this.content_type = content_type;
- this.http_code = http_code;
- }
- }
- }
- public static void index() {
- render();
- }
- public static void options(String url, final String callback) {
- response().setHeader("Access-Control-Allow-Origin", "*");
- response().setHeader("Allow", "*");
- response().setHeader("Access-Control-Allow-Methods", "POST, GET, PUT, DELETE, OPTIONS");
- response().setHeader("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, Referer, User-Agent");
- return ok();
- }
- The file /app/controllers/Application.java could not be compiled. Error
- raised is : The method response() is undefined for the type Application
Add Comment
Please, Sign In to add comment