Guest User

Untitled

a guest
Dec 10th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. public class Application extends Controller {
  2.  
  3. public static class Result {
  4. public Result(String contents, Status status) {
  5. this.contents = contents;
  6. this.status = status;
  7. }
  8.  
  9. public final String contents;
  10. public final Status status;
  11.  
  12. // "status":{"url":"https://mtgox.com/api/0/data/ticker.php","content_type":"application/json","http_code":200
  13.  
  14. public static class Status {
  15. public final String url;
  16. public final String content_type;
  17. public final int http_code;
  18.  
  19. public Status(String url, String content_type, int http_code) {
  20. this.url = url;
  21. this.content_type = content_type;
  22. this.http_code = http_code;
  23. }
  24. }
  25. }
  26.  
  27. public static void index() {
  28. render();
  29. }
  30.  
  31. public static void options(String url, final String callback) {
  32. response().setHeader("Access-Control-Allow-Origin", "*");
  33. response().setHeader("Allow", "*");
  34. response().setHeader("Access-Control-Allow-Methods", "POST, GET, PUT, DELETE, OPTIONS");
  35. response().setHeader("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, Referer, User-Agent");
  36.  
  37. return ok();
  38. }
  39.  
  40. The file /app/controllers/Application.java could not be compiled. Error
  41. raised is : The method response() is undefined for the type Application
Add Comment
Please, Sign In to add comment