두 개의 웹 응용 프로그램, 태피스 트리 응용 프로그램 및 간단한 웹 응용 프로그램 (servelt)이 있습니다. 태피스 트리 appli에서, 나는 양식을 가지고 있고, 그것이 보내질 때, 나는 apache의 httpClient를 사용하여 appli에 정보를 보내기 위해 httpClient를 호출한다. 이 같은 Tapestry, 다른 응용 프로그램에서 처리 요청
void onSubmitFromForm() {
try {
HttpClient client = new DefaultHttpClient();
HttpPost post = new HttpPost("http://localhost:8080/appli2/recep");
post.setHeader("referer", "http://localhost:9090/app1/start");
List<NameValuePair> param = new ArrayList<NameValuePair>();
param.add(new BasicNameValuePair("_data", getData());
post.setEntity(new UrlEncodedFormEntity(param));
HttpResponse response = client.execute(post);
response ?????
} catch (Exception e) {
e.printStackTrace();
}
}
그리고 간단한 웹 어플리 내 servelt의 레셉의
(2) 내가 할 같은protected void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
try {
HttpClient client = new DefaultHttpClient();
HttpPost post = new HttpPost(request.getHeader("referer"));
post.setHeader("p",getP());
client.execute(post);
} catch (Exception e) {
e.printStackTrace();
}
}
그래서, 내 레셉의 reviev의 내 양식의 데이터 만 it'cannot가 대응 방법 아래와 같이 , 단순한 웹 응용 프로그램에서 테이퍼 형 응용 프로그램이 매개 변수 'P'를받을 수 있습니까? 감사합니다.
예 괜찮습니다. 감사합니다. – FiesAtoS