0
두 개의 grails 응용 프로그램이 application1과 application2 있습니다. application1은 HTTPBuilder를 사용하여 하나의 템플릿 (gsp 페이지)을 반환하는 application2를 호출합니다. 어떻게하면 응용 프로그램에 gsp 페이지 (응답)를 표시 할 수 있습니까? 1. 상태 코드 200이 있습니다. 그 후에 페이지를 표시하려면 어떻게해야합니까? 응답을 반환하는 방법은 무엇입니까?grails에서 내 HTTPBuilder는 gsp 페이지를 반환하는 하나의 나머지 URL을 호출합니다 .gsp 페이지를 표시하는 방법은 무엇입니까?
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
}
}
사용자 작업이 하나의 gsp 페이지를 반환합니다.
'상태 코드 302가 있습니까?'라는 의미는 무엇입니까? –
내 응답의 상태 – Anantha
그래서,'html'로 응답해야합니다, 맞습니까? –