Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
Java Books Media Programming Book Reviews

Review:Java Servlet Programming 41

CowboyNeal has taken some time out of his busy schedule to review Java Servlet Programming, a new ORA book out, written by Jason Hunter with William Crawford. Full of tips to extend the usage of the servlets, click below for more informatiion.
Java Servlet Programming
author Jason Hunter & William Crawford
pages
publisher O'Reilly & Associates
rating 8
reviewer CowboyNeal
ISBN 1-56592-391-X
summary O'Reilly is known for it's in-depth, tell-all approach to computer related topics. This book doesn't disappoint and features many different ways to use Java Servlets, many of which may not occur to the average CGI scripter.

What's Good?

I used Java Servlets almost immediately after their release, and always liked the idea of platform-indepent scripts that could give one the same functionality as CGI scripts. It didn't take long for me to discover that servlets aren't limited to returning only web pages, but this book explores several options that one may not think of right off.

The examples given are of use in practical real-world situations, whether it's connecting to a database to generate pages, editing images on the fly, or writing applets that connect to servlets. After reading the examples, you can easily see where you could utilize the concepts in server-parsed web pages.

Having written countless web scripts in Perl, I was pleased to see all of the major concepts of web scripting covered within the context of servlets. Java Servlet Programming includes a JDBC primer, as well as sections on session tracking and security issues.

What's Bad?

Not much. Seriously, O'Reilly books make up a large part of my personal library because they don't disappoint. The entire Java series is full of great books, and this one continues the trend. If you don't know much Java, this book isn't going to hold your hand through it, as it assumes that you're fairly secure in your knowledge of Java, and that you're comfortable using objects in Java.

Who should buy this book?

If you like Java and think that everything should be written in it, including your web scripts, then this is the book for you. I would consider this the best reference for servlet programming to date, and it beats the hell out of the standard documentation. If you're thinking about brewing up a Java servlet, this is the reference you want.

If you want to buy this book, head over to Amazon.

Table of Contents

Preface

  1. Introduction
  2. HTTP Servlet Basics
  3. The Servlet Life Cycle
  4. Retrieving Information
  5. Sending HTML Information
  6. Sendind Multimedia Content
  7. Session Tracking
  8. Security
  9. Database Connectivity
  10. Applet-Servlet Communication
  11. Interservet Communication
  12. Internationalization
  13. Odds and Ends

Appendix A: Servlet API Quick Reference

Appendix B: HTTP Servlet API Quick Reference

Appendix C: HTTP Status Codes

Appendix D: Character Entities

Appendix E: Charsets

Index

This discussion has been archived. No new comments can be posted.

Review:Java Servlet Programming

Comments Filter:
  • Does the book cover the Servlet/EJB connection ?

    Can anyone poiint to good on-web references ?

  • Do we really need a book on servlet programming? I've been using Java servlets (via the Apache jserv module) for sometime and they are quite simple to use. Plugging JDBC into it to access a database is pretty straightforward. I guess I just don't see that there is anything complicated enough to justify writing an entire book on it. Am I missing something?

  • Posted by The Mongolian Barbecue:

    that the Java logo looks like a cup of coffee with a large turd floating in the center of it?
  • title says it all. GnuJSP for Apache-Jserv is at 0.99, the only thing left is for Sun to finalize the specification.

    Oh, and did I mention Cocoon [apache.org]? Stefano's "XSP" idea (XML Server Pages) is probably the direction where JSP is headed anyhow.

  • There are a lot of clever hacks which Hunter shows how to do, and he's *not* a dull blade. You might want to leaf through it before shooting off -- things like image manipulation and security are in this book, and I found those to be quite helpful. Oh, and sessions. Sessions are tres cool.

    If you're a wizard then duh, it won't help you. In that case head on over to the cocoon website [apache.org] and think about contributing to the project. Show everyone what a stud you are and work with some really neat material at the same time.

  • Take a look at Using Apache-Jserv [magiccookie.com] and persevere. It took me a little while to set things up in Linux, but now we have embedded Java and Perl interpreters and everyone's delighted.

    Also, I don't have to depend on an evil monolithic corporation for my server software this way.

  • If you have trouble getting mod_jserv [apache.org] built and
    running, take a look at Ari Halberstadt's great
    guide to Using Apache-Jserv [magiccookie.com]. It can save you time and frustration.

    You could also hire him. (heheheh)

    Finally, for Apache 1.3.4 and 1.3.6, save yourself some trouble by symlinking {APACHE_INSTALL}/bin to {APACHE_INSTALL}/sbin.

  • So far I like Zope. Python is clean and simple. The database interface is simple and orthogonal: you write SQL "methods" that incorporate the input parameters, controlling optional SQL just like you control optional HTML in the web pages. In the web pages, you can invoke a Python method, database method, or external code with the same syntax; this includes iterating over the results within the HTML page.

    I don't miss Perl's regexp engine at all, because I simply don't need to use it under Zope.
  • Hmmm... finally the book cover from ORA isn't an animal. Now on with the "Silverware Series". Guess there'll be some "The Final Guide To Fork'ing And Exec'ing" with a cute fork on the cover...nahhh
  • Sounds good, what is it? I've been looking for a 'template' layout that is java-based, and open standards. I remember using a JHTML thing a long time ago, but don't know who made it.

    Zipwow
  • Yeah,

    It's got a Javan Tiger on it (believed to be extinct, last seen in 1972)

    Mark
  • No, the book doesn't provide much advice for setting up servlets, and they take the easy road out by doing development with Sun's Java Web Server. The book is geared toward the developer, but it doesn't help with building Jserv or any other engines.

    From personal experience, I tried for a long time (about 3 weeks with many rebuilds) to set up the Apache Jserv on Solaris with Apache 1.3.4 and could never get it to work. I was able to get Apache and JRun (from www.livesoftware.com) to work, but some things were flaky with the class loader.

    I'm not doing my testing with Sun's Web Server. Don't get me wrong, Apache rules. I would rather use Apache, but if you want to use Servlets with ease and get going without much headache, the Java Web Server is really quite good. It is a nice alternative if you can't get Jserv or JRun working right.
  • Just to echo the reviewer's thoughts... I just finished reading this book and I am *very* impressed. I don't plan on writing a cgi script again as long as I can use servlets. The book is probably the most thorough I've read about a specific Java topic.
  • There is a short section about how to use Servlets with Java Beans, however since the Enterprise Java Beans API isn't officially released they don't have specific info on that. The introspection examples with Java Beans are pretty good.
  • You can also use IBM's websphere, although I haven't heard much about it. You can run Sun's Java WebServer on Linux or other Java 1.1.6 enabled systems, but Sun will only Support it on Solaris or NT. My experience with JWS is that it is a little slower than Apache (I haven't pushed it really hard though) but it is easy to set up. A caveat - I've been administering Apache servers for over two years, so I'm speaking from experience, not bellyaching about anything.

    The Java Web Server costs $300, and Apache is free. Consider the cost of JWS as a support cost in case you need it... which is rather cheap as support goes.
  • Actually none of ORA's java series have animals, starting from Exploring Java 1st edition I believe.

    In addition all the Linux Book have cowboys, and I'm not sure what their travel books have
  • Book is one of the better O'Reilly books I've bought, and I've bought a good few. It has both variety and depth. The only thing that confused me was the cover. Aren't teapots supposed to be reserved for books on 3D graphics? :-)
  • One of the best O'Reilly books. Awesome.
  • According to the book, JSP came along just before the book went to press. There are about five pages on JSP, but it serves only to convey the general idea, especially since Sun has since introduced a radically different version of the spec.

    JSP looks really cool; once a 1.0 spec comes along, I'll be excited to use it.

  • I've seen instructions (on blackdown.org, I think...) about getting Sun's JWS set up and running on other OSs. It' is 100% pure java - you know, write once, run anywhere. ;-)

    -Bill
  • In all of the online documentation concerning servlets, I've only been able to find material that covers the HTTPServlet. Does this book get into the GenericServlet in any depth as far as implementing/extending goes?
  • I've quickly gone through this book with a relatively simple project in mind, but with so many options I'm not sure which tools to invest my learning time in. On one hand, I know a little Java, and servlets seem relatively easy.. on the other hand there are things like perl and Zope (python) that seem popular. Anyone have any contructive comments from experience ?
    In case it matters, the intended project is a dynamic website with a database backend.
  • Actually, virtually all the ORA books in the Java series (with the notable exception of Java in a Nutshell) have pictures of objects on the cover, not animals.

    AWT has a can of paint, Distributed Computing has Tinkertoys, Security has a bird's nest with eggs in it. You can browse through them at . Kinda cool. [oreilly.com]
  • So my options are

    a solaris box running Suns Java WebServer
    a solaris or linux box runing apache and JRun
    a solaris or linux box runing apache and Jserv

    anything else?
  • Does this book have details on setting up the server end of Java Servlets? Is there a different book i should get for this purpose. Or is there a good website to goto to walk me through the entire process?
  • This excellent book is THE definitive guide to servlet programming. Jason Hunter succeeds in showing us that servlet technology goes well beyond simply "replacing cgi". The book's companion web site (http://www.servlet.com) is a must for anyone seriously interested in servlets. Thumb up for Jason
  • There are a lot of clever hacks which Hunter shows how to do, and he's *not* a dull blade. You might want to leaf through it before shooting off -- things like image manipulation and security are in this book, and I found those to be quite helpful. Oh, and sessions. Sessions are tres cool.


    If you're a wizard then duh, it won't help you. In that case head on over to the cocoon website [apache.org] and think about contributing to the project. Show everyone what a stud you are and work with some really neat material at the same time.

  • Servlets are pretty cool and this book covers the subject perfectly.

    Oh , and I bought it for 9.95$ including shipping at www.fatbrain.com and using the FATBRAIN code (plus got a cool cap).

    [ but if you want to contribute to Ron, get it from amazon with the link provided above ]
  • I found that JSP (Java Server Pages) when used in conjunction with Servlets often provided a good complement in cases where the HTML code is the bulk of the output and the code is just filling in a few places in the template. Some coverage of this would have been a service to the web development community. Plus, despite its bugs, JSP has ASP beat in that Java is 100x better for programming anything over 10 lines than VBScript.

  • If you interested in trying out servlets try

    http://java.apache.org/
  • Hey-

    If you're interested in Servlets, check out this new site.
    www.coolservlets.com [coolservlets.com]
    It is all about open-source servlets and they have a few packages available already!
    CHET OUT
  • by jabbo ( 860 ) <jabboNO@SPAMyahoo.com> on Friday April 16, 1999 @11:50AM (#1930174)
    If you're a pro, and want to write code that could comfortably live in an algorithms book (eg. "executable pseudocode"), Python is The Way. But I never got PyApache to compile and I don't like using anything but Apache so I gave up on Zope (couldn't get it to work via pcgi with Apache).

    Then there's Perl. It's ugly and it WORKS. That's all there is to it. Do what you will, just don't let a newbie Perl hacker anywhere near a production mod_perl system or you will regret it.
    Perl is tightly integrated with the Apache API via mod_perl, so you can do damn near anything in Perl that you can in C. Like AOLServer and Tcl or Roxen and Pike, Perl and Apache are an item. For building up libraries of reusable functions and objects you create Perl modules, simple as that.

    Java servlets are like Scheme programs if you do them right. You get a bunch of beautifully polished classes (because it just takes too damn long to write crappy code in Java) that are ideal for reuse, if you prototyped and designed well. Sessions are great, and the servlet API makes them trivial to use. Servlets are much, much better (IMHO) for production systems that have been slapped together as prototypes in something like Perl or Python. (an interesting extension to this idea is using JPython to write servlets... haven't heard of any recent successes but you could try) And the Apache-Jserv project is a great community thing -- very dynamic, lots of great new ideas. But Java is a (manually) compiled, strongly typed language and a servlet usually takes more time to write than the equivalent one-shot Perl script.

    My boss likes writing servlets because he can't deal with Perl, but doesn't mind Java at all. I like prototyping in Perl because it's fast, but god damn it feels good to come up with an elegant class and stick it in our local project's .jar. People who hack on supercomputers and BSD guts invariably seem to love Python, but I would have trouble hooking up Python to Oracle as cleanly as we have done with Java and Perl (total abstraction from the database via JDBC and DBI). So go with what makes you happy, it'll keep you from burning out. And use ApacheDBI if you go with Perl. ;-)

I think there's a world market for about five computers. -- attr. Thomas J. Watson (Chairman of the Board, IBM), 1943

Working...