2 posts by 2 authors in: Forums > CMS Builder Community
Last Post: May 10, 2017   (RSS)

* @author bzwang ** /
Public class DynInfo2Html {/ *** Translate information into static html
* @param sSourceUrl dynamic information access URL
* @param sDestDir is stored as a directory of static files
* @param sHtmlFile generated static file name, you can press the information unique ID + .html named
* @throws IOException * / public static void convert2Html (String sSourceUrl, String sDestDir, String sHtmlFile) throws IOException {int HttpResult;
URL url = new URL (sSourceUrl);
URLConnection urlconn = url.openConnection ();
Urlconn.connect ();
HttpURLConnection httpconn = (HttpURLConnection) urlconn;
HttpResult = httpconn.getResponseCode ();
If (HttpResult! = HttpURLConnection.HTTP_OK) {} else {InputStreamReader isr =
New InputStreamReader (httpconn.getInputStream ());
BufferedReader in = new BufferedReader (isr);
String inputLine;
If (! SDestDir.endsWith ("/")) sDestDir + = "/";
FileOutputStream fout = new FileOutputStream (sDestDir + sHtmlFile);
While ((inputLine = in.readLine ())! = Null) {
Fout.close ();} in.close (); fout.close ();}}

I want to generate static pages for the dynamic pages of my site:okyalo.com, is this feasible?


What version of CMS Builder are you using?

Why do you need to generate static pages?

There is software available that allows you to save sites off line.

Damon Edis

Hire me! Save time by getting our experts to help with your project.