how to maintain session?

hi

i wish capturing the output of a jsp page into a html file....

using the code below

URL url =new URL("http://localhost:4263/webapplication/mail/web/login.jsp");

URLConnection con = url.openConnection();

InputStream in = con.getInputStream();

OutputStream out2 =new FileOutputStream("c:/file1.html");

.

.

//code...

the problem is the session for the requested url expires and desired output is not obtained

how to maintain it....

[655 byte] By [BRAVOa] at [2007-11-27 11:02:31]
# 1

The session is identified with cookies (and sometimes with URL arguments).

Maintain cookies across multiple HTTP connections, and your sessions will remain.

paulcwa at 2007-7-29 12:43:55 > top of Java-index,Java Essentials,Java Programming...