This file contains 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
app.parentname = "objectpartners.com" |
This file contains 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
class Customer { | |
@Value('${app.parentname}') | |
String parentName | |
String username | |
static constraints = { | |
} | |
} |
This file contains 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
class CustomerController { | |
def grailsApplication | |
def createSpring() { | |
def customer = grailsApplication.mainContext.getBean(Customer.class) | |
customer.username = params.username | |
customer.save() | |
assert customer.parentName == "objectpartners.com" | |
render customer as JSON | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment