Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Applet - Servlet Communication

 
Girish Solanke
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I want to pass the varialble from Applet to Servlet.
I have wriiten code for that,
But Apllet is not loaded by the use of Tomcat[version used --> 4.* to 5.5].
It says that classnotfound Exception.......

I used html file to Call Applet,
then Applet has to Call the servlet,
But it is not working ...............
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello "g ssssss"-

Welcome to JavaRanch.

On your way in you may have missed that JavaRanch has a policy on display names, and yours does not comply with it - please adjust it accordingly, which you can do right here. Thanks for your prompt attention to this matter.

Enjoy your time here.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As to your question, there are several things to investigate and/or describe for us:
  • Does the applet work when run locally from the filesystem, instead of off the web server?
  • Are there any messagea in the Java Console?
  • What does the applet tag look like?
  • Where do you keep the class files on the web server?
  • Are the classes downloadable manually?


  • [ March 03, 2006: Message edited by: Ulf Dittmer ]
     
    Girish Solanke
    Greenhorn
    Posts: 13
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Originally posted by Ulf Dittmer:
    As to your question, there are several things to investigate and/or describe for us:
  • Does the applet work when run locally from the filesystem, instead of off the web server?
  • Are there any messagea in the Java Console?
  • What does the applet tag look like?
  • Where do you keep the class files on the web server?
  • Are the classes downloadable manually?


  • [ March 03, 2006: Message edited by: Ulf Dittmer ]
     
    Girish Solanke
    Greenhorn
    Posts: 13
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Originally posted by Ulf Dittmer:
    As to your question, there are several things to investigate and/or describe for us:
  • Does the applet work when run locally from the filesystem, instead of off the web server?

  • Ya it is Working ....
  • Are there any messagea in the Java Console?

  • No
  • What does the applet tag look like?

  • <APPLET NAME="myApplet" CODE="com.servlets.EchoApplet"
    WIDTH=400 HEIGHT=400></APPLET>
  • Where do you keep the class files on the web server?

  • it is in class folder in WEB-INF
  • Are the classes downloadable manually?

  • I am not UNDERSTAND this Question ............


    [ March 03, 2006: Message edited by: Ulf Dittmer ]
     
    Ulf Dittmer
    Rancher
    Posts: 42968
    73
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Hello Girish-

    Thanks for changing your screen anme. It's still not quite right, though, because it needs to contain a first name and a last name. Please change it again so that it conforms to the policy.

    Where do you keep the class files on the web server?
    it is in class folder in WEB-INF

    That's the problem then. The class/jar files need to be in the same directory as the applet. The servlet engine will not serve any files to a client that are located inside the WEB-INF directory.
     
    Ben Zung
    Ranch Hand
    Posts: 109
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    I don't know why but this had worked for me.

    My applet: TestApplet.class
    Package: my.applet.test
    (And the html is in the same level of dir "my".

    Non-working version:
    <applet code="TestApplet.class" codebase="my/applet/test" ...>

    Working version:
    <applet code="my/applet/test/TestApplet.class" codebase="." ...>

    Good luck.
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic