> ... in essence what I want to do, is
    > create a java program that within a loop
    > sends requests (myjsp.jsp?id=x) and
    > save the output to idx.html.

Although I don't fully understand your description, I'll focus on what I
think you are asking: how do I save my "response" to an html file? Something
like this should work:

<%
    // let's setup the essentials:
    // put in your server file path, such as this one for an NT:
    String path = "c:\\InetPub\\myDataFiles" ;

    // read the request id parameter
    String id = request.getParameter("id") ;
    // create your response
    String myResponse = "<http><body>my html " +
                        "page in response to Request id = " +
                        id + "blablabla... </body></http>" ;

    // send your response to the requesting browser
    out.println( myResponse ) ;

    // save the response to a file,
    // using the id given us by the browser
    File fn = new File( path + "id" + id + ".html" ) ;
    try
    {
        ObjectOutputStream fout = new ObjectOutputStream(
                        new FileOutputStream( fn ) );
        fout.writeObject(database);
        fout.close();
    } catch (Exception e)


        // do some error trapping here
    }
%>

Hope this helps.

Phil


-----Original Message-----
From: Frank Apap <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Thursday, June 01, 2000 7:16 PM
Subject: Creating static jsp pages.


>If I have a jsp, lets call it myjsp.jsp, and it takes a paramter id.  How
>can I save the html created by myjsp.jsp?id=1 to a file (lets say
id1.html),
>not doing a save as w/ a browser b/c I will need to do it for id from 1 ..
>1000.
>
>So in essence what I want to do, is create a java program that within a
loop
>sends requests (myjsp.jsp?id=x) and save the output to idx.html.  The
>problem is I have no clue how to code that program.
>
>Any help would be great.
>
>- Frank
>
>===========================================================================
>To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
>Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to