呼び出されると jsp にリダイレクトする (struts 2) アクションがあります。HttpClient を使用して、この jsp を html に保存しようとしています。jsessionid=RandomText
これは、html に別のアクションが存在する場合にサーバーが追加するという 1 つのことを除けば、問題なく機能します。
最終的な html から jsessionid を削除するにはどうすればよいですか?
レンダリングされた html のサンプル:
<a href='/wah/destinationSEO.action;jsessionid=123ASDGA123?idDestination=22'>
これは、jsp を html に保存する方法です。
DefaultHttpClient httpClient = new DefaultHttpClient();
HttpGet getRequest = new HttpGet("http://127.0.0.1:8080/wah/destinationSEO.action?idDestination=8");
HttpResponse response = httpClient.execute(getRequest);
if (response.getStatusLine().getStatusCode() != 200) {
throw new RuntimeException("Failed : HTTP error code : "
+ response.getStatusLine().getStatusCode());
}
httpClient.getConnectionManager().shutdown();
String content = CharStreams.toString(new InputStreamReader(response.getEntity().getContent()));
String path="D:/wahSVN/trunk/src/main/webapp/seo.html";
File html = new File(path);
html.createNewFile();
Files.append(content, html, Charsets.UTF_8);