Wednesday, 28 September 2016

How to solved the issue when commit is failed by index.lock file in Git

follow these commands in command prompt:

my project autoris in projects folder


after deleting the file clean your project and then start.

Thursday, 1 September 2016

insert and display using webservices in grails

def add() {
def wine_requ = [
name: "Forster Ungeheuer 133",
address: "Germany 233"
]

def url = new URL("http://localhost:8080/tomcat/place")
def wine_resp = url.openConnection().with {
requestMethod = "POST"
doOutput = true
setRequestProperty("Content-Type", "application/json;charset=UTF-8")
outputStream.withWriter("UTF-8") { new StreamingJsonBuilder(it, wine_requ) }
new JsonSlurper().parse(inputStream.newReader("UTF-8"))
}
render wine_resp
}

def place() {
def url = new URL("http://localhost:8080/tomcat/place")
def urlConnection = url.openConnection()
urlConnection.with {
requestMethod = "GET"
doOutput = true
}

BufferedReader buff = new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
render buff.readLine()
}