You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ram karthik <ra...@agastha.com> on 2010/10/10 04:43:40 UTC

Fw: Applet Servlet communication in Tomcat 7


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.

Re: Fw: Applet Servlet communication in Tomcat 7

Posted by Pid <pi...@pidster.com>.
On 10/10/2010 07:52, Ram karthik wrote:

> ________________________________
> From: Warren Henning <wa...@gmail.com>
> To: Tomcat Users List <us...@tomcat.apache.org>
> Sent: Sun, October 10, 2010 10:42:20 AM
> Subject: Re: Fw: Applet Servlet communication in Tomcat 7
> 
> On Sat, Oct 9, 2010 at 7:43 PM, Ram karthik <ra...@agastha.com> wrote:
>> 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
>>
> 
> From what you stated, there's no way of knowing whether the problem is
> on your end in the applet or something with Tomcat.
> 
> You didn't specifically state what the actual error was and so without
> giving more detailed information about what you expected to happen and
> what happened instead I don't see what we can do.
> 
> Warren


>
> Hi Warren,
>
> Thanks for your response.
>
> I didn't got any errors either in java console Or in tomcat 7 logs.
actually the
> code is working well in tomcat 6. the same code do not work with
tomcat 7, also
> want to know do we need to set any specific settings for applet servlet
> communication in tomcat 7.
>
> Thanks,
> Ram Karthik.


Pretend I don't believe that the applet is broken in Tomcat 7.0.  Please
prove that it is broken.

Producing log data from Tomcat which indicates an error would be a good
start.


p





Re: Fw: Applet Servlet communication in Tomcat 7

Posted by Ram karthik <ra...@agastha.com>.

Hi Warren,

Thanks for your response.

I didn't got any errors either in java console Or in tomcat 7 logs. actually the 
code is working well in tomcat 6. the same code do not work with tomcat 7, also 
want to know do we need to set any specific settings for applet servlet 
communication in tomcat 7.

Thanks,
Ram Karthik.
Agastha Inc.





________________________________
From: Warren Henning <wa...@gmail.com>
To: Tomcat Users List <us...@tomcat.apache.org>
Sent: Sun, October 10, 2010 10:42:20 AM
Subject: Re: Fw: Applet Servlet communication in Tomcat 7

On Sat, Oct 9, 2010 at 7:43 PM, Ram karthik <ra...@agastha.com> wrote:
> 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
>

>From what you stated, there's no way of knowing whether the problem is
on your end in the applet or something with Tomcat.

You didn't specifically state what the actual error was and so without
giving more detailed information about what you expected to happen and
what happened instead I don't see what we can do.

Warren

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org

Re: Fw: Applet Servlet communication in Tomcat 7

Posted by Warren Henning <wa...@gmail.com>.
On Sat, Oct 9, 2010 at 7:43 PM, Ram karthik <ra...@agastha.com> wrote:
> 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
>

>From what you stated, there's no way of knowing whether the problem is
on your end in the applet or something with Tomcat.

You didn't specifically state what the actual error was and so without
giving more detailed information about what you expected to happen and
what happened instead I don't see what we can do.

Warren

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org