Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

for attention of wushutwist or pieterwinter

Status
Not open for further replies.

sedj

Programmer
Aug 6, 2002
5,610

Hello,

I hope you can help me in a problem .. I've been programming java just under a year, and feel, whle competent in some areas, still a novice in others. The area which I have become interested in, mainly due to incoming changes at work, and new ICT structures (hopefully a move away from Microsft ASP and related data manipulation methods). i have no friends.
 
Yeah funny (my brother wrote that last comment).

Anyway, after beating him sensless......to continue ...

I have been writing classes around jdbc data access to Oracle DBMS, and have written a database interface server, and also (simple compared to Tomcat I guess) web server, however am confused over the whole servlet issue. In my understanding, in escence all a webserver does is process incoming data requests, and output responses, after validation and security checking. So once looking into the servlet API, I am a little confused as to :
a) why I need it
b) why I cant implement my own ....

In effect , I don't quite get what the whole servlet thing will do for me - considering that all Http is, is serving files onto a specific web address. I don't know if I have just gone too low-level, and missed out the convenience of an already written API, whether I've missed the point completely , or what really.....is it not possible to server jsp pages from my own server ? Is this stupid considering tomcat is available ?

In essence, my problem is this - why run servlets withn a server - if all a servlet does is serve data - which is what the server does anyway ??

I hope I have made my query clear .. if not please let me know,

Best Wishes,

Ben
 
I'm not either of the two posters that you asked for but let me try to help.

An application server is just that...an application server. The application is the part that you write. In the old days, application developers had to write everything from scratch. They needed to program all of the container services that their application needed including database pooling, connection handling, security, etc. These days, those are the services that the application server provides in a standardized way. Thus, you only need to 'plug in' to the common container services that your application needs. The server is essentially this... a container in which your application runs that provides these core services.

You are somewhat confusing a web server with a servlet engine. Servlets and JSP's are for serving dynamic content, e.g. customized content that may require a database backend. For simply serving up static content, there are many mature web servers (including free ones like Apache) so there is little point in writing a web server except as a learning tool.

On the other hand, you would have a hard time writing an ecommerce site like amazon using static content--it essentially requires dynamic presentation, a database backend and session management...all things that can't be done with static content.
 
Hi Ben,

I think meadandale has made some valid points on the subject.

Personally, I haven't had much hands-on experience with web servers and servlets.

Tomcat is a servlet engine, which has a simple web interface also. Apache is a web server, and can use Tomcat (apache can be configured to support lots of different server-side processing mechanisms, one of which is Tomcat). Tomcat can deal with servlets and JSP files. For most cases, JSP file processing will suffice for dynamic content, if you want to display "dynamic" content (i.e. generated on the "server side"). Servlet programming is a more low-level approach (more low-level than JSP's) that you could use e.g. to program a particular web-service.

HTH
Pieter

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top