This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Tomcat and the fly likes can i run applet on server? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "can i run applet on server?" Watch "can i run applet on server?" New topic
Author

can i run applet on server?

anchit pancholi
Ranch Hand

Joined: Oct 14, 2010
Posts: 53
i have a applet.class file and index.html file.

i want to run applet on server is it possible??

i have one jar file which have applet.class file and i mention this class in index.html.

my index.html file is have:-



and my web.xml file is



i am getting error. myapp not found.
i think i need to modify web.xml file and where i need to put it ???
please help me where i m going wrong.

thanks in advance

Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
Simple: an applet is not a servlet. There's nothing you can do about that in the web.xml. If you want to run servlets, then you need to write your code as such, and put it in the appropriate place (WEB-INF/classes or WEB-INF/lib).
anchit pancholi
Ranch Hand

Joined: Oct 14, 2010
Posts: 53
Tim Moores wrote:Simple: an applet is not a servlet. There's nothing you can do about that in the web.xml. If you want to run servlets, then you need to write your code as such, and put it in the appropriate place (WEB-INF/classes or WEB-INF/lib).


so you mean to say is -- i need to write servlet and by that servlet i can access applet(so that mean i need not to make any modification in my web.xml file)
thanks for quick reply.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19556
    
  16

An applet is meant for the client side, not for the server side. What's inside it that you need on the server side?


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
so you mean to say is -- i need to write servlet and by that servlet i can access applet(so that mean i need not to make any modification in my web.xml file)

No. Applets don't run on the server, period.
anchit pancholi
Ranch Hand

Joined: Oct 14, 2010
Posts: 53
Rob Spoor wrote:An applet is meant for the client side, not for the server side. What's inside it that you need on the server side?


ya i know it is client side but there is any way by that i can run server or mention in web.xml i know it will not work but i want to know other way to achieve that.
and applet have nothing to run one client side nut i have some database query that show in browser.

thanks
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
Whatever you need done on the server will not involve an applet. What you need is a servlet.
anchit pancholi
Ranch Hand

Joined: Oct 14, 2010
Posts: 53
Tim Moores wrote:Whatever you need done on the server will not involve an applet. What you need is a servlet.


ok i got it ... so that mean it can only achieve by servlet only. thanks tim thanks a lot
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: can i run applet on server?
 
Similar Threads
Change URL http/unbeatableonline.com/swbeatableonline.com to http/unbeatableonline.com
Http status 500 Error instantiating servlet class peigov.businessportal.servlets.LoginServlet
The requested resource is not available
*.faces suffix mapping