• Post Reply Bookmark Topic Watch Topic
  • New Topic

How much the book cover for the new networking features of J2SE 5.0 Tiger?  RSS feed

 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mr.Elliotte,
I just would like to know how does the book cover the topics for the new networking features of J2SE 5.0 Tiger. I don't see that Tiger got many new features for networking APIs. I think that nio package is there since Java 1.4. So could you explain a bit (if any) how the book talks about the enhancement in networking API of Tiger? THanks.
 
Elliotte Rusty Harold
author
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java 1.5 adds several new classes, and a few methods scattered throughout the API. Probably the most significant additions are the CookieHandler and Proxy classes. The Proxy class lets applications choose proxy strategies on a much more finely-grained, per-connection basis rather than on the per-VM basis that was the only easy option in earlier versions.

The CookieHandler class provides hooks for cookie callbacks from the HTTP protocol handler used by the URL and URLConnection class. This makes third party HTTP libraries less necessary. However, the CookieHandler class is abstract and you have to roll your own implementation (an example is given in
Chapter 8), so the support for cookies is still not complete.
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Elliotte Rusty Harold:
The CookieHandler class provides hooks for cookie callbacks from the HTTP protocol handler used by the URL and URLConnection class. This makes third party HTTP libraries less necessary. However, the CookieHandler class is abstract and you have to roll your own implementation (an example is given in Chapter 8), so the support for cookies is still not complete.

Mr.Elliotte,
I heard that the use of Cookies in many web applications is discouraged, since it can affect the security and privacy issue in the applications. Do you have any opinions on why Sun is still making enhancement in J2SE 5.0 for Cookie support?

Or is it just for the low-level networking APIs? Could you give some comment on this view point of Cookie Support? Thanks.
 
Elliotte Rusty Harold
author
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I completely agree that cookies are a bad idea. They are completely contrary to the web architecture. If you're designing a server side, web application, and you're using cookies, you're doing it wrong.

That said, there are a lot of poorly designed web application out there written by uneducated developers, and if you want to write client side code that interoperates with them, you need to handle cookies. In my opinion, client-side cookie support in Java is long overdue. I only wish it were more complete. Oh well. Maybe in Java 1.6. :-(
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!