I have a (struts 2) action which on being called redirects to a jsp. I'm trying to save this jsp to html using HttpClient. This works fine apart from one thing, server appends jsessionid=RandomText
wherever another action is present in the html.
How can I remove jsessionid from the final html ?
Sample from rendered html:
<a href='/wah/destinationSEO.action;jsessionid=123ASDGA123?idDestination=22'>
This is how I am saving the jsp to 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);