tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ram karthik <>
Subject Fw: Applet Servlet communication in Tomcat 7
Date Sun, 10 Oct 2010 02:43:40 GMT

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 = != -1) {
     response.append((char) chr);
Writer output = null;
File newfolder = new File(localPath);
boolean newflag = newfolder.isDirectory();
if (!newflag) {
File file = new File(localPath + fileName);                  
output = new BufferedWriter(new FileWriter(file));
output.write(response.toSt ring());

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%>">

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

Ram Karthik.
Agastha Inc.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message