• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Why servlet is better than Applet

 
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Applet can do much more than Servlet or JSP in GUI in browser.
But less and less people using Applet. Why?
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
They are different technologies.

While there is some general overlap, Applets are 'rich clients' and require java to be installed in the browser on the client and must run inside a secured applet container which restricts the abilities of the Applet. They also have some cross platform problems that effect their use. Also, the general trend is against rich clients, although my feel is that this is starting to turn.

Web applications are thin clients which (in general) only need the broswer to support HTTP and HTML. Quite a bit is being added to web applications, such as varieties of JavaScript (logic, validation, dynamic content and Ajax), plugins and such that are pushing more functionality into the browser.
 
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's a client-side technology versus a server-side technology match. Applet extends the capability of the client browser while Servlet extends the capability of the web server.

Why use Servlet instead? Again, it's another match between thin client design and rich client design.

Depends on the design decisions, one might be more suitable than the other under certain circumstances.
 
Glen Cai
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by David O'Meara:
They are different technologies.

While there is some general overlap, Applets are 'rich clients' and require java to be installed...



Do all the Browsers come with a JVM?
 
Author
Posts: 531
Mac OS X Netbeans IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Glen Cai:


Do all the Browsers come with a JVM?




No not all of them , As far as i know just Opera shipped with a bundled JRE

you should download jre for other Browsers like IE , FF ,...
HTH
 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Masoud Kalali:
...As far as i know just Opera shipped with a bundled JRE...


Of course, Apples come with Java, so the Mac browser, Safari, is ready to go.

(I would also note that much of what applets did in the early days is now better handled by entirely different technologies, like Flash or script.)
[ October 15, 2005: Message edited by: marc weber ]
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There was a brief shining moment when Applets were first introduced that many predicted the end of HTML pages. Everyone would want rich user interfaces coded in Java! It just never worked out; applets were big enough they took too long to download, the browsers were not compatible enough and many other reasons. I was kind of disappointed ... coding rich apps in HTML and JavaScript and even the hip new AJAX architecture is not very satisfying to me.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The question is a bit like asking which is better: a hammer or a screw-driver. Both are tools that perform somewhat related tasks, but neither is a substitute for the other.
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Firewall is a big issue for Applet...
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jim Bao:
Firewall is a big issue for Applet...



How so?
 
Jim Bao
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Ben Souther:


How so?



I saw many Applets used RMI to talk to Server.
It would be OK if a special port opened for it in firewall.

Servlet uses HTTP on port 80. They are default open for all firewall.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So the problem is with RMI, not with applets.
There are other ways for applets to communicate with the server.
 
Jim Bao
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Ben Souther:
So the problem is with RMI, not with applets.
There are other ways for applets to communicate with the server.



Like what?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Object serialization over HTTP.
XML RPC

Both can operate nicely over port 80.
[ October 17, 2005: Message edited by: Ben Souther ]
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I remember feeling bitterly disappointed when, after the initial excitement about this newfangled Java thing and applets that could be displayed on Web pages, I realized how poorly applets were integrated with HTML. They couldn't inspect the page they were embedded in. They couldn't interact with the forms they were next to. It was a great disappointment to me and seemed like an enormous oversight.

Then came Netscape 2.0 with Java support, and JavaScript and LiveConnect, but it was all too flaky and poorly documented and complicated. It was also a great disappointment.

What I wanted then -- and I suppose still would like now -- is a client-side language that was as well-integrated with the browser as JavaScript, but which had the capabilities of Java. If you could do everything JavaScript can do, and also create new form widget types with it, imagine the possibilities!
 
Jim Bao
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Ben Souther:
Object serialization over HTTP.
XML RPC

Both can operate nicely over port 80.

[ October 17, 2005: Message edited by: Ben Souther ]



They are mostly implemented with Servlet.
Now you are asking Browser to support j2ee.
I think the JRE comes with Browser is J2SE.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No, the browser doesn't need to implement j2ee for either of these.
There is a very small XML-RPC project on the apache site.
Object serialization over HTTP doesn't require anything but a JRE.

My point was that it's not accurate to claim that applets alone cause firewall problems.
[ October 17, 2005: Message edited by: Ben Souther ]
 
Jim Bao
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Ben Souther:
No, the browser doesn't need to implement j2ee for either of these.
There is a very small XML-RPC project on the apache site.
Object serialization over HTTP doesn't require anything but a JRE.

My point was that it's not acurate to claim that applets alone cause firewall problems.



I guess the jar file of the "very small XML-RPC project of apache" is not
with most of the Browsers. Do you need to load it in the Browser for
each client?

Could you tell us how to do "HTTP-tunneling" in Java w/o using Servlet?
Do you need to build HTTP in your Java code?

It is not just port 80 but also HTTP protocol to make
the call going through the firewall. E.g., an IIOP call on port 80 will not go through.

If the Applets do not need to call servers (RMI, SocketServer, EJB, Corba...) or they are working inside firewalls, they should be OK.
It is normally very hard to let security people to open a port in firewall
for your application.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jim Bao:

Could you tell us how to do "HTTP-tunneling" in Java w/o using Servlet?
Do you need to build HTTP in your Java code?



To do object serialization, you would need Java on the server.
I didn't mean to imply otherwise.

You can do HTTP-Tunneling with any server side technology though.
The first time I've seen it done was with Perl on the server.
In that example, the servlet was posting form encoded strings with the
UrlConnection object, and receiving delimited strings in return.
In short, to answer your question, yes, you would do this with HTTP.

As for xml-rpc, you would need to include the libraries with your applet.
Here is the url if you're interested:
http://ws.apache.org/xmlrpc/

I agree, it is hard to get people to open firewall ports.
 
Glen Cai
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What I'm looking for is 3D GUI (similar to Java3D) in browser.
I think HTML or Servlet can not do it. Is it possible to use
Applet with Java3D?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Glen Cai:
What I'm looking for is 3D GUI (similar to Java3D) in browser.
I think HTML or Servlet can not do it. Is it possible to use
Applet with Java3D?



Glen,
You might want to start a new thread for this question.
Long threads like this often get ignored by people who've already read the first 4 or 5 posts and then lost interest.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
reply
    Bookmark Topic Watch Topic
  • New Topic