Thats not what I really meant. but thanks tho. Im looking for a way to do
this code in a client application :
(this is obviosly not real code)
for (int i = 0; i < 1000; i++)
{
sendRequestToServer("http://mysite.com/myjsp.jsp?id="+i);
// Dont know how to really do this
String bigString = getHtmlFromSite();
// or this.
saveToFile("id"+i+".html", bigString);
}
- Frank
----- Original Message -----
From: Phil Campbell <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, June 01, 2000 11:40 PM
Subject: Re: Creating static jsp pages.
> > ... 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
>
===========================================================================
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