Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- curl -H "Accept: application/json" http://localhost:8080/myproject/example
- <html><head><title>Apache Tomcat/7.0.55 - Error report</title><style><!--H1
- [deleted font family lines...]
- {color : black;}A.name {color : black;}HR {color : #525D76;}--></style>
- </head><body><h1>HTTP Status 404 - "/WEB-INF/grails-app/views/example/index.gsp" not found.</h1>
- <HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b>
- <u>"/WEB-INF/grails-app/views/example/index.gsp" not found.</u></p><p>
- <b>description</b> <u>The requested resource is not available.</u></p>
- <HR size="1" noshade="noshade"><h3>ApacheTomcat/7.0.55</h3></body></html>
- package com.mycompany.rest
- import groovy.transform.EqualsAndHashCode;
- import groovy.transform.ToString;
- @ToString(includeNames = true, includeFields = true, excludes = 'dateCreated, lastUpdated')
- @EqualsAndHashCode
- class Example {
- Long id
- Long version
- Date dateCreated
- Date lastUpdated
- String name
- String description
- static constraints = {
- name blank:false, nullable:false
- description blank:false, nullable: false
- }
- }
- package com.mycompany.rest
- import grails.rest.RestfulController;
- class ExampleController extends RestfulController<Example> {
- static responseFormats = ['json', 'xml']
- ExampleController() {
- super(Example)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement