|
A web server is also called a Hypertext Transfer Protocol (HTTP) server because it uses HTTP to communicate with its clients, which are usually web browsers. A Java-based web server uses two important classes, java.net.Socket and java.net.ServerSocket, and communicates through HTTP messages. Therefore, this article starts by discussing of HTTP and the two classes. Afterwards, I'll explain the simple web server application that accompanies this article. All communication over the Internet happens using a standard set of protocols, such as File Transfer Protocol (FTP), Simple Mail Transfer Protocol (SMTP), Post Office Protocol (POP), Hypertext Transfer Protocol (HTTP), and so on. HTTP is one of the most popular of these protocols and is integral to the World Wide Web. It is also a protocol that many of today?s applications have to be aware of and use wisely. If a Java application has to interact using HTTP, the Commons HttpClient component can make things a bit easier. Using this component, you do not have to worry about all the technicalities of the protocol but just concern yourself with the various classes and methods provided by the HttpClient component. In this article you will have a look at the capabilities of the HttpClient component and also some hands-on examples. This year, it released the iPlanet Web Server, Enterprise Edition 4.1 (iWS), boasting support for JSP 1.1, native JVMs (1.2), and the Servlet API 2.2 (minus the WAR files). With all that's going on in the world of servlets and JSP these days, I figured it was time someone took a look at what the folks at Netscape and Sun were doing to support Java at the Web server level. I've worked with all the major servlet engines at one point or another, and I wanted to see if iWS's support was compelling enough to replace veterans in the third-party market such as Allaire's Jrun and eWave's ServletExec (the original developers of these products were both purchased within the last year), and heavyweights such as IBM's WebSphere or BEA's WebLogic. This is an example of a very simple, multithreaded HTTP server. Here is the .java file for the example as well. Take a look at a sample property file for the example web server. I was somewhat skeptical when I started investigating the tie-in between Subversion, NetBeans IDE, and WebDAV. Product add-ons sometimes do not work well together, fail to meet user expectations, or are awkward or difficult to use. In this case, everything worked as expected. The NetBeans Subversion module and the Mobility Pack combined with Sun Java System Web Server save time and simplify two important development tasks. Now that I have the Subversion server and Sun Java System Web Server installed on my Ultra 25 workstation, I will continue to use them on subsequent projects. Fortunately, the principles of object-oriented programming can solve this problem, because each object tells each of the other objects it communicates with how it wants to deal with data. In this article, I will outline a simple way to transfer data from Result Sets to Vectors, so that the Vectors can be distributed to a Web server. The Web server, in turn, can access the values in the Vector using Server-Side JavaScript. |
w___w__w.__jav_a__2__s__.___c__o_m___ | Contact Us |
Copyright 2009 - 12 Demo Source and Support. All rights reserved. |
All other trademarks are property of their respective owners. |