I have two grails applications are application1 and application2. application1 use HTTPBuilder to call the application2 that return one template(gsp page). How can i display gsp page(the response) in my application1.I got status code 200. after that what i will do to display the page?how to return that response?
static def users(String akey,String userName){
try {
def ret = null
def http = new HTTPBuilder("http://192.168.1.7:8080/Play0.1/main/userGroup")
http.request(Method.POST, ContentType.HTML) {
uri.query = [ aKey:aKey, userName:userName]
headers.'User-Agent' = 'Mozilla/5.0 Ubuntu/8.10 Firefox/3.0.4'
response.success = { resp,html -> println resp.status
}
response.failure = { resp -> println "Unexpected error: ${resp.status} : ${resp.statusLine.reasonPhrase}" }
}
return ret
} catch (groovyx.net.http.HttpResponseException ex) {
ex.printStackTrace()
return null
} catch (java.net.ConnectException ex) {
ex.printStackTrace()
return null
}
}
That users action returns one gsp page.