HACKING JAVA™: THE PROFESSIONAL'S RESOURCE KIT

6 December 2007 |



Because this book assumes that you already know how to program in Java, you already have a good idea of what features are in the Java language. This book will notteach you how to program in Java; it takes the next step by showing you what you can do with Java and how to do it.

Java as a Web Programming Language

Much of the initial appeal of Java comes from the fact that it can be embedded in Web pages. It allows you to go beyond the static nature of Web pages by making your pages come alive.Using Java's Abstract Windowing Toolkit (AWT), you can create interactive forms that go beyond the simple act of filling in a bunch of fields and clicking the Submit button. You can perform error checking on forms, provide context-sensitive help, even give the user suggestions or examples. Some of these things you can do without Java, but not as quickly.

Java allows you to improve the interaction between the client and the server. The HTTP protocol, the native language of the World Wide Web, is very specific and somewhat restrictive as far as the interaction between the client and server. Whenever a client needs to send data to the server, it must open up a network connection, send a set of headers and the request data, and then sit and wait for a response. The server has very few options for sending data to a client. It must wait for the client to send it information, and the only option it has for sending back multiple responses is the "multi-part" message, in which the server sends part of a response, and then later sends more of the response. Given the static nature of Web pages, this has always been considered acceptable. Also, because the network connection is closed after a server has sent a response back to the client, there is no notion of a session within HTTP. Clients and servers have had to come up with their own interesting ways of maintaining session information between requests. The Netscape Cookie protocol is one such method...

Download full article: http://www.megaupload.com/?d=OJVECC21

0 cangkeman: