Review:Java Servlet Programming
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
- Introduction
- HTTP Servlet Basics
- The Servlet Life Cycle
- Retrieving Information
- Sending HTML Information
- Sendind Multimedia Content
- Session Tracking
- Security
- Database Connectivity
- Applet-Servlet Communication
- Interservet Communication
- Internationalization
- 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
If you're a wizard then duh, it won't help you. In that case head on over to the cocoon website 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.
Remember that what's inside of you doesn't matter because nobody can see it.
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 ]
- sigs are for wimps.
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
It is all about open-source servlets and they have a few packages available already!
CHET OUT
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).
.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. ;-)
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
Remember that what's inside of you doesn't matter because nobody can see it.