我有一個被稱爲重定向到jsp的(struts 2)動作。我試圖用HttpClient把這個jsp保存到html。除了一件事情之外,這可以很好地工作,服務器追加jsessionid=RandomText
任何其他操作出現在html中的任何地方。如何從html中刪除jsessionid(從jsp轉換而來)
如何從最終的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);
我可以知道我應該在哪裏得到這段代碼嗎? – J888 2013-10-15 00:43:01