Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

New to servlets - a few random easy questions

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1)Is any Java program that runs on a server and communicates with a client considered to be a 'servlet'?

2)I have read that Tomcat or Jserv(e?) are needed to run servlets on a server. Is Tomcat a more advanced replacement for Jserv, or are they both up to date alternate means of handling servlets?

3)I want to send a stream of data from an applet to a java program on the server, and have the Java program store the data in a file. Must this Java program be a 'servlet' handled by Tomcat or Jserv?

Thanks.
 
Ranch Hand
Posts: 472
Objective C Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Anomander Rake:
1)Is any Java program that runs on a server and communicates with a client considered to be a 'servlet'?


Generally yes, however it has to be compliant or extend servlet class.


2)I have read that Tomcat or Jserv(e?) are needed to run servlets on a server. Is Tomcat a more advanced replacement for Jserv, or are they both up to date alternate means of handling servlets?


Tomcat supports J2EE deployment of servlets and servlet spec. after 2.2.
It supports also addition to servlets as JSP. Jserv is out of support.


3)I want to send a stream of data from an applet to a java program on the server, and have the Java program store the data in a file. Must this Java program be a 'servlet' handled by Tomcat or Jserv?


It can be but fair not a requirement. However, using right servlet container can solve scalability in simple way, like you have thousands applets willing to send a stream to your program.


Thanks.

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1)Is any Java program that runs on a server and communicates with a client considered to be a 'servlet'?
servlets and JSPs are java programs run on a web server compliant with the Sun Java Servlet APIs and handle web requests.
For other Client-server application (eg Chat application), programs running on server need not be considered to be a 'servlet'

2)I have read that Tomcat or Jserv(e?) are needed to run servlets on a server. Is Tomcat a more advanced replacement for Jserv, or are they both up to date alternate means of handling servlets?
Servlets can be run on any servlet engines. Tomcat, Jserv are web servers compliant with the Sun Java Servlet APIs.
Yes, I think Tomcat is more advanced than JServ. Tomcat version 5 implements the Servlet 2.4 specification, whereas JServ implements the servlets 2.0 specification.

3)I want to send a stream of data from an applet to a java program on the server, and have the Java program store the data in a file. Must this Java program be a 'servlet' handled by Tomcat or Jserv?
Servlets can be regarded as service extensions added to a server. Servlets takes a request, process it and sends a response back.
Your applet sends a request containing data to the web server, the program that process this request (storing in a file) in the server is a Servlet.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic