[SOLVED]Convert JSP to static HTML...
Hi guys... Sorry I wasn't able to get back to you immediately on this question I had asked... I was pretty busy on other things and had asked my friend to work on the same... The way he had implemented was by using the Apache Commons HTTP Client... Here is code snippet... It's very simple... HttpClient client = new HttpClient(); StringBuffer url = new StringBuffer(http://localhost:8080/E47;); url.append(/CMSWebDriver?actionName=aacommandName=ccId= + Id); // Create a method instance. HttpMethod method = new GetMethod(url.toString()); // Execute the method. try { // execute the method. int statusCode = client.executeMethod(method); } catch (HttpRecoverableException e) { System.err.println(A recoverable exception occurred, retrying. + e.getMessage()); } catch (IOException e) { System.err.println(Failed to download file.); e.printStackTrace(); System.exit(-1); } // Read the response body. byte[] responseBody = method.getResponseBody(); // Release the connection. method.releaseConnection(); Thanks to all that gave me inputs... They were really useful -Joseph Nicholson, Robb [EMAIL PROTECTED] wrote: The Apache Commons HTTP Client (see org.apache.commons.httpclient.* packages) makes it pretty easy to make HTTP requests and get the response back as a String. -Original Message- From: Jacob Wilson [mailto:[EMAIL PROTECTED] Sent: Friday, January 23, 2004 4:28 PM To: [EMAIL PROTECTED] Subject: Convert JSP to static HTML... Hi All... I have a specific requirement in my project... I want to convert the JSP pages to static html pages and save them in a local directory... How do I achieve this functionality??? Any suggestions appreciated. Thanks much. -Jacob - Do you Yahoo!? Yahoo! SiteBuilder - Free web site building tool. Try it! - Do you Yahoo!? Yahoo! SiteBuilder - Free web site building tool. Try it!
Re: Convert JSP to static HTML...
Jacob. *Simple*: When you browse through your app right mouse click View Page Source and per copy and paste to a html file. *More difficult*: That is possible to do automatic. You need a little program that accessed the side via an URL http://my.server/myapp/dosomething.do and gets the http-reqeust to save it into a file. I have written such thing in delphi to grab websites and get some informations, I think in java may that not so bad. Manfred Jacob Wilson wrote: Hi All... I have a specific requirement in my project... I want to convert the JSP pages to static html pages and save them in a local directory... How do I achieve this functionality??? Any suggestions appreciated. Thanks much. -Jacob - Do you Yahoo!? Yahoo! SiteBuilder - Free web site building tool. Try it! -- === Dipl.-Inf. Manfred Wolff --- phone neusta : +49 421 20696-27 phone : +49 421 534522 mobil : +49 178 49 18 434 eFax : +49 1212 6 626 63 965 33 --- Diese E-Mail enthält möglicherweise vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet. This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Convert JSP to static HTML...
how about a shell script that calls wget? ( http://www.gnu.org/software/wget/wget.html ) Ive used that a couple of times with good results. Cheers Lawrence -Original Message- From: Manfred Wolff [mailto:[EMAIL PROTECTED] Sent: Mon 26/01/2004 14:26 To: Struts Users Mailing List Cc: Subject: Re: Convert JSP to static HTML... Jacob. *Simple*: When you browse through your app right mouse click View Page Source and per copy and paste to a html file. *More difficult*: That is possible to do automatic. You need a little program that accessed the side via an URL http://my.server/myapp/dosomething.do and gets the http-reqeust to save it into a file. I have written such thing in delphi to grab websites and get some informations, I think in java may that not so bad. Manfred Jacob Wilson wrote: Hi All... I have a specific requirement in my project... I want to convert the JSP pages to static html pages and save them in a local directory... How do I achieve this functionality??? Any suggestions appreciated. Thanks much. -Jacob - Do you Yahoo!? Yahoo! SiteBuilder - Free web site building tool. Try it! -- === Dipl.-Inf. Manfred Wolff --- phone neusta : +49 421 20696-27 phone : +49 421 534522 mobil : +49 178 49 18 434 eFax : +49 1212 6 626 63 965 33 --- Diese E-Mail enthlt mglicherweise vertrauliche und/oder rechtlich geschtzte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtmlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet. This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Convert JSP to static HTML...
I haven't tried this bit of code (modified it from something else) but it should work. Just add in the file writing part and you are away. try { StringBuffer urlString = new StringBuffer(http://my.server.co.uk;); urlString.append(/myapp/dosomething.do); URL url = new URL(urlString.toString()); String savedHtml = ; BufferedInputStream ins = new BufferedInputStream(url.openStream()); BufferedReader br = new BufferedReader(new InputStreamReader(ins)); StringBuffer sb = new StringBuffer(); String line = br.readLine(); while (line != null) { sb.append(line); sb.append(\n); line = br.readLine(); } savedHtml = sb.toString(); } catch(MalformedURLException mue) { Log.fatal(url exception :+mue.getMessage()); } catch(IOException ioe) { Log.fatal(io error :+ioe.getMessage()); } //write html out to a file here Chris -Original Message- From: Manfred Wolff [mailto:[EMAIL PROTECTED] Sent: 26 January 2004 14:26 To: Struts Users Mailing List Subject: Re: Convert JSP to static HTML... Jacob. *Simple*: When you browse through your app right mouse click View Page Source and per copy and paste to a html file. *More difficult*: That is possible to do automatic. You need a little program that accessed the side via an URL http://my.server/myapp/dosomething.do and gets the http-reqeust to save it into a file. I have written such thing in delphi to grab websites and get some informations, I think in java may that not so bad. Manfred Jacob Wilson wrote: Hi All... I have a specific requirement in my project... I want to convert the JSP pages to static html pages and save them in a local directory... How do I achieve this functionality??? Any suggestions appreciated. Thanks much. -Jacob - Do you Yahoo!? Yahoo! SiteBuilder - Free web site building tool. Try it! -- === Dipl.-Inf. Manfred Wolff --- phone neusta : +49 421 20696-27 phone : +49 421 534522 mobil : +49 178 49 18 434 eFax : +49 1212 6 626 63 965 33 --- Diese E-Mail enthält möglicherweise vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet. This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] *** This e-mail and its attachments are confidential and are intended for the above named recipient only. If this has come to you in error, please notify the sender immediately and delete this e-mail from your system. You must take no action based on this, nor must you copy or disclose it or any part of its contents to any person or organisation. Statements and opinions contained in this email may not necessarily represent those of Littlewoods. Please note that e-mail communications may be monitored. The registered office of Littlewoods Limited and its subsidiaries is 100 Old Hall Street, Liverpool, L70 1AB. Registered number of Littlewoods Limited is 262152. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Convert JSP to static HTML...
The Apache Commons HTTP Client (see org.apache.commons.httpclient.* packages) makes it pretty easy to make HTTP requests and get the response back as a String. -Original Message- From: Jacob Wilson [mailto:[EMAIL PROTECTED] Sent: Friday, January 23, 2004 4:28 PM To: [EMAIL PROTECTED] Subject: Convert JSP to static HTML... Hi All... I have a specific requirement in my project... I want to convert the JSP pages to static html pages and save them in a local directory... How do I achieve this functionality??? Any suggestions appreciated. Thanks much. -Jacob - Do you Yahoo!? Yahoo! SiteBuilder - Free web site building tool. Try it!
Convert JSP to static HTML...
Hi All... I have a specific requirement in my project... I want to convert the JSP pages to static html pages and save them in a local directory... How do I achieve this functionality??? Any suggestions appreciated. Thanks much. -Jacob - Do you Yahoo!? Yahoo! SiteBuilder - Free web site building tool. Try it!