aspose file tools*
The moose likes Servlets and the fly likes New to servlets - a few random easy questions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "New to servlets - a few random easy questions" Watch "New to servlets - a few random easy questions" New topic
Author

New to servlets - a few random easy questions

Anomander Rake
Greenhorn

Joined: May 31, 2005
Posts: 7
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.
D Rog
Ranch Hand

Joined: Feb 07, 2004
Posts: 472

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.


Retire your iPod and start with HD Android music player Kamerton | Minimal J2EE container is here | Light weight full J2EE stack | and build tool | Co-author of "Windows programming in Turbo Pascal"
Indraneel A Das
Greenhorn

Joined: May 16, 2005
Posts: 9
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: New to servlets - a few random easy questions
 
Similar Threads
Inter servlet communication
Problems getting servlets to work on Tomcat 4
Servlets on Apache Web Server
java servlets support JSP?????
Problems getting servlets to work on Tomcat 4