aspose file tools*
The moose likes Applets and the fly likes Can applet be part of webpplication ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Can applet be part of webpplication ?" Watch "Can applet be part of webpplication ?" New topic
Author

Can applet be part of webpplication ?

nikitha kakani
Greenhorn

Joined: Dec 15, 2007
Posts: 25
Hi everone ,Actually i am developing a project in MVC1 architecture .But i got a requirement that when client sends request to server through browser ,the code that is servlet (server) need to open ports of client system that sent the request (so i knew that applet is the one that helps)
do i need to place applet in client system(tomcat webapps) or do i need to place in server ? & which tomcat i need to start ?
Nicholas Jordan
Ranch Hand

Joined: Sep 17, 2006
Posts: 1282
Tomcat is the server.


Applet is written in Java code, compiled an placed somewhere on the server, in a certain directory. The html wrtten to the browser has the applet's name, which is written in the <applet ...> tag. The browser, acting as the client, goes through the work of asking the Server for the web application's downloadable code which may be run in the applet engine at the browser end.

Do you have a server running somewhere ?


"The differential equations that describe dynamic interactions of power generators are similar to that of the gravitational interplay among celestial bodies, which is chaotic in nature."
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

You're not going to be able to open ports on the client's system.

Even applets run in a security sandbox that keeps from accessing anything on the client's machine. With a signed applet, you may be able to do this but even then, the end user would have to approve this.

Also, there is no such thing as MVC1.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42596
    
  65
This is a continuation of this topic, but I'm not sure what you're asking beyond what was discussed there ... ?


Ping & DNS - my free Android networking tools app
nikitha kakani
Greenhorn

Joined: Dec 15, 2007
Posts: 25
thanks for the reply by mistake i wrote MVC1 its Model View Controller .ok .
nikitha kakani
Greenhorn

Joined: Dec 15, 2007
Posts: 25
yes my server (tomcat ) is running on different system .
Nicholas Jordan
Ranch Hand

Joined: Sep 17, 2006
Posts: 1282
Originally posted by nikitha kakani:
...(snip)...requirement that when client sends request to server through browser ,the code that is servlet (server) need to open ports of client system that sent the request (so i knew that applet is the one that helps)


Maybe we disentangle ports from Applets, leave the port questions in the post linked by Ulf. I think we need to start with some vocabulary building:

  • Server - Usually used as a programming concept, I use this term to convey the notion of a physical machine somewere. May or may not be java. The terminology servlet is used somewhat interchangebly with Server, but a servlet is programming code - a server may refer to the physical machine as well as Tomcat or the word Servlet. Some thought is necessary for even the simplest use of the term server.
  • An applet is code that runs on the client side, this usually means the browser. The applet provides additional capabilites beyond simple display of data.

  • do i need to place applet in client system(tomcat webapps) or do i need to place in server ? & which tomcat i need to start


    You compile the code, using class SimpleApplet extends Applet and a java compiler. You then place the files on the server (tomcat ) is running on different system . using File Transfer Protocol. You start the Tomcat on the server, there is not a Tomcat on the client side. ( Unless you want to have a server locally for testing ) How you start Tomcat depends on the server's implementation - a fancy Tomcat will detect uploaded files, some have to be started from a shell prompt. You upload the compiled Applet, it gets shipped out when the page load is selected in the browser. Do you know how to do ftp ? If so, request instructions for directory structure from the administrator of the server ( on the other machine )
    nikitha kakani
    Greenhorn

    Joined: Dec 15, 2007
    Posts: 25
    thanks for the corrections thanks alot for the help
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: Can applet be part of webpplication ?