Just set up a URL to point to the url where the jsp lies and save the results.
 
ex.
 
Just write out the string returned to a file.

/**
 *  HttpPing.  Used to ping specified urls.
 * <P>
 * @author Derek DeMoro
 */
package jsp.beans;

import java.net.URL;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.net.MalformedURLException;

public class HttpPing extends Object
{

 /**
 * Get html from specified url.
 * @param url - The url to ping.
 */
  public static String getUrlResults(String url)
  {
    String urlString = null;
    StringBuffer urlBuffer = new StringBuffer();

    try
    {
      //Hand the Url Object a URL address.
      URL theUrl = new URL(url);

      try
      {
        //Open an input stream from the URL
        BufferedReader in = new BufferedReader(new InputStreamReader(theUrl.openStream()));

        try
        {
          //Read Contents From URL
          while ((urlString = in.readLine()) != null)
          {
            urlBuffer.append(urlString);
            urlBuffer.append("\n");
          }
        }
        catch(Exception ioEx)
        {
          ioEx.printStackTrace();
        }
      }
      catch(Exception ex)
      {
        ex.printStackTrace();
      }
   }
   catch(MalformedURLException malformedEx)
   {
      malformedEx.printStackTrace();
   }
   return urlBuffer.toString();
  }
}

 

Derek DeMoro
Senior Member Of Technical Staff For Oracle Jdeveloper
Oracle Corp.

 

----- Original Message -----
From: cH3rN0b|L
Sent: Monday, November 20, 2000 9:21 AM
Subject: Anyway to render JSP to static HTML? -- What happens with Cocoon XSP servlet examples?

Hi all!
I was wondering if we can retake the topic I read sometime ago in the list
talking about saving JSP results to static HTML.
I'm hard behind that, but I have no luck with the answers.
I'm using Apache 1.3.12, Tomcat 3.2b5 and Cocoon 1.8 on RedHat 7.0,
working toghether, after some hard work to configure it.
I need ,in some cases, JSP results stored in static html files
instead of sending the results to the client  internet navigator.
 
Another question could be why in Tomcat 3.2b5 isn't included the
xml.jar file, that suspectly starts XSP in Cocoon, because I couldn't
ever start that XSP servlet examples that comes with Cocoon.
TIA for any answer that could help me.
 
Iv�n Font�n
Technical Department
 
LATINIA CORPORATION
www.latinia.com
 
Spain Office
Barcelona
Trav. Gr�cia, 342-344
08025 Barcelona (Spain)
Tel.: +34 934 465 026
 
US Offices
New York
885 3rd Avenue
Suite 2800
New York, NY 10022
 
Miami
1210 Brickell Avenue
Suite 430
Miami, FL 33131

Reply via email to