Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can applet be part of webpplication ?

 
nikitha kakani
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is a continuation of this topic, but I'm not sure what you're asking beyond what was discussed there ... ?
 
nikitha kakani
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for the reply by mistake i wrote MVC1 its Model View Controller .ok .
 
nikitha kakani
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes my server (tomcat ) is running on different system .
 
Nicholas Jordan
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
    Posts: 25
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    thanks for the corrections thanks alot for the help
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic