Hi Folks,

I have applet code for connecting servlet, It works fine in Tomcat 6, when i 
upgraded the tomcat version to 7. it is not working.

Using this code for connecting Servlet. this will download a file to client 
machine but it is not going to servlet itself. 

URL servletURL = new URL(url);
URLConnection servletConnection = servletURL.openConnection( );
servletConnection.setDoOut put(true);
servletConnection.setUseCa ches(false );
InputStream in = servletConnection.getInput  Stream();
StringBuffer response = new StringBuffer();
int chr;
while ((chr = in.read()) != -1) {
     response.append((char) chr);
}
in.close();
Writer output = null;
File newfolder = new File(localPath);
boolean newflag = newfolder.isDirectory();
if (!newflag) {
   newfolder.mkdirs();
}
File file = new File(localPath + fileName);                  
if(file.exists())
    file.delete();                  
output = new BufferedWriter(new FileWriter(file));
output.write(response.toSt ring());
output.close();

the below one is applet code

<applet name="loadApps" code="com.utilapps.UtilApp lication.c  lass" 
codebase="../utilapps/" archive="../utilapps/utila pps.jar" width="300" 
height="300" align="baseline">
<param name="fileName" value="<%=fileName%>">
</applet>

and the debugs got in console

basic: Applet made visible
basic: Starting applet
network:  Connecting https://localhost/utilApp/ servlet/Ut ilAppsServ 
let?mode=0 
& fileName= filea.ARA with proxy=DIRECT
network: Connecting https://localhost/utilApp/ servlet/Ut ilAppsServ let?mode=0 
& fileName=  fileb.ARA with cookie "user=help; ZP_CAL=%27........"
network: Server https://localhost/utilApp/ servlet/Ut  ilAppsServ let?mode=0 & 
fileName= filec.ARA requesting to set-cookie with "JSESSIONID=AC3E134CEAF903 
20BA442DF8 81B8F5AD.t omcat7; Path=/utilApp; Secure; HttpOnly"
basic: Applet started

Eagerly waiting for your reply. Please let me know if i need to change any 
settings in Tomcat 7

Thanks,
Ram Karthik.
Agastha Inc.

Reply via email to