Advertisement
Guest User

Untitled

a guest
Oct 24th, 2014
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. curl -H "Accept: application/json" http://localhost:8080/myproject/example
  2.  
  3. <html><head><title>Apache Tomcat/7.0.55 - Error report</title><style><!--H1
  4. [deleted font family lines...]
  5. {color : black;}A.name {color : black;}HR {color : #525D76;}--></style>
  6. </head><body><h1>HTTP Status 404 - "/WEB-INF/grails-app/views/example/index.gsp" not found.</h1>
  7. <HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b>
  8. <u>"/WEB-INF/grails-app/views/example/index.gsp" not found.</u></p><p>
  9. <b>description</b> <u>The requested resource is not available.</u></p>
  10. <HR size="1" noshade="noshade"><h3>ApacheTomcat/7.0.55</h3></body></html>
  11.  
  12. package com.mycompany.rest
  13.  
  14. import groovy.transform.EqualsAndHashCode;
  15. import groovy.transform.ToString;
  16.  
  17. @ToString(includeNames = true, includeFields = true, excludes = 'dateCreated, lastUpdated')
  18. @EqualsAndHashCode
  19. class Example {
  20.  
  21. Long id
  22. Long version
  23. Date dateCreated
  24. Date lastUpdated
  25.  
  26. String name
  27. String description
  28.  
  29.  
  30. static constraints = {
  31. name blank:false, nullable:false
  32. description blank:false, nullable: false
  33. }
  34. }
  35.  
  36. package com.mycompany.rest
  37.  
  38. import grails.rest.RestfulController;
  39.  
  40. class ExampleController extends RestfulController<Example> {
  41.  
  42. static responseFormats = ['json', 'xml']
  43.  
  44. ExampleController() {
  45. super(Example)
  46. }
  47.  
  48.  
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement