aspose file tools*
The moose likes Other Application Frameworks and the fly likes Is there a good Spring book? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "Is there a good Spring book?" Watch "Is there a good Spring book?" New topic
Author

Is there a good Spring book?

Linda Walters
Ranch Hand

Joined: Apr 30, 2005
Posts: 100
I have been trying to work through Manning's "Spring in Action" by Craig Walls and Ryan Breidenbach and I find it to be a very frustrating task because the code examples are so incomplete.

I have yet to find any samples, even the very first "Hello World" that will work as written.

I have read Amazon reviews, for what they are worth, of Apress's "Pro Spring" and they make the same complaint.

Is there any Spring book that is any good?
I don't want to waste my money on another dud like "Spring in Action".


<a href="http://labryssystems.net/pblog/index.php" target="_blank" rel="nofollow">Javaville Gazette</a><br />Non-cooperation with evil is a duty. -- Mahatma Gandhi
Sonny Gill
Ranch Hand

Joined: Feb 02, 2002
Posts: 1211

I use Pro Spring and Java Development with the Spring Framework, and I am satisfied with both. But at the moment, I am mostly using Spring MVC and the Bean Factory only, and I am not too concerned about incomplete code examples. In fact, I prefer those to full code listings.

I find that Pro Spring is good for quickly getting an idea of what Spring has to offer on a given subject. And Java Development... gives you more in-depth information.

Also, here are some Spring blogs that I find useful -

http://www.memestorm.com/blog
http://jroller.com/page/buggybean
http://www.springdeveloper.com/

HTH

Sonny
Linda Walters
Ranch Hand

Joined: Apr 30, 2005
Posts: 100
Sonny,

Thanks, "Pro Spring" and the Spring and MVC were my next two choices, but I didn't want to plunk down the money if they were no better than "Spring in Action".

I realize that sample code can't always be provided 100%, but it would be nice if the very first example, a simple "Hello World" to show you how Spring works would actually work so that the reader can see what happens without trying to correct the author's errors.

Very disappointing for the usually terrific Manning Press books.
Jeroen T Wenting
Ranch Hand

Joined: Apr 21, 2006
Posts: 1847
I've never really liked Manning books much, I prefer O'Reilly by far.

Their Spring developer's notebook is quite good.
Examples work (though they're not always given literally, requiring some thinking which is IMO a good thing).
Only place you may/will have problems is in hooking up external packages like Hibernate which change their public interfaces more rapidly than authors can keep up with writing changelogs and errata for their books.


42
Sonny Gill
Ranch Hand

Joined: Feb 02, 2002
Posts: 1211

Linda,

Are you looking for a simple Hello World in Spring MVC?
If so, try Developing a Spring Framework MVC application step-by-step?
It is also included in the docs directory in the Spring download.

It is a pretty good introduction. When I tried it a while ago, it had some very minor errors to do with JSTL taglib urls. Otherwise, everything worked fine.

Also, have you checked online errata for your book?
Linda Walters
Ranch Hand

Joined: Apr 30, 2005
Posts: 100
Sonny,

It's not so much that I want to do the "Hello World", its that I bought this book (which like most computer books is not cheap) and the very first example, which looks fairly complete, doesn't even work. I know that not all examples can be complete, but this is really lame. Imagine if you picked up a book on Java and it had a "Hello World" example that didn't work, what would you think?

You would waste a lot of time trying to figure out what you did wrong, just as I did with this Spring book. After I had double checked classpaths, etc. and tried compiling the sample files from both commandline and from Eclipse to be certain that I was doing things correctly I just dropped it.

I have taught lots of classes on various software topics to both academic and industry classes and one thing you always want to do is give your audience at least one, small, simple example that works just as written so they know that they get the idea and they can see how it works. THEN you can give them code snippets and partial examples for them to complete.

This weekend, when I have the time, I'll check out other Spring books at the local technical book store, get one and just advise others to steer clear of this one.
Jeroen T Wenting
Ranch Hand

Joined: Apr 21, 2006
Posts: 1847
Never use any IBM software then. Their examples never work...
I used to program with IBMs C libraries for OS/2, we had a standing joke in the office that as long as you did it differently from what was mentioned in the documentation it would probably work.
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 4991
    
    8

Linda,

I didn't find the "Spring in Action" book to be that bad; I actually think the book is a pretty decent resource for Spring. True, there is a little bit more to do than just typing in the sample code in your IDE and clicking the "Run" button. Unfortunately, that leaves hands-on readers like yourself who may be unfamiliar with frameworks like this in a bit of a lurch.

I did have to change the code a bit to make it run:



I used Eclipse to run the program. Aside from typing in the code and making the change to the line that would not compile, I just had to put the Spring jars and the commons logging jar in the build path. The build path bit was the only thing I had to do that was not explicitly instructed in the book. And the program ran fine.

If you have any more difficulties with the book, just post a question here and I'm sure somebody can help you figure out a way around the problem. It would be a shame and a waste of good money and of a good resource on Spring for you to dismiss this book because it wasn't immediately obvious to you to do the two things I did to make the HelloApp program run. Even a busted clock is right two times a day. This book may be a little busted (just take a look at its errata page) but there's still quite a few things in it that can make it worth its price for you.

BTW, all the Spring books that I own are quite dog-eared now but my favorite reference for Spring is "Pro Spring" with "Spring in Action" and "Professional Java Development with the Spring Framework" sharing equal time as backups.

Hope this helps.
[ May 06, 2006: Message edited by: Junilu Lacar ]

Junilu - [How to Ask Questions] [How to Answer Questions]
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

Their Spring developer's notebook is quite good.

Are you kidding ?
I have not read it, but Amazon's reviews were enough to refrain me from reading it.

I've read Spring In Action which is more than enough to give you a good understanding of Spring.
I found the last part on Security a bit difficult and out-dated, but other than that, no complaints.
I actually prefer to figure out samples by myself, rather than typing those in the book.


[My Blog]
All roads lead to JavaRanch
Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3479

Linda,
don't go with Spring Developer's Handbook at all !
I don't believe that Oreilly did this book, code is not working, bad explainations and ...
If you do a small search onjava.com , you can get many sample snipets of this book and you will not like their smell.
Do you want code (alot of code) ? get Spring Live from SourceBeat.
Matt Raible (author of Spring Live) did a massive work in his book, he shows you how to use Spring with Struts, WebWork, Tapestry, Spring MVC, other view technologies, transaction, Hibernate, security and many other things (ah, I forgot about unit tests).
And personaly, Spring In Action is not bad, it is a good reference indeed.
Please note, I'm not a pro or something, but here is my recommended list :
----
Spring's documentation (Yes it is great, it is better than many books).
Hibernate In Action (in the case you want to hibernate your data).
Spring In Action
POJO In Action
Linda Walters
Ranch Hand

Joined: Apr 30, 2005
Posts: 100
Well, I got "Pro Spring" this past Friday night and I'm well on the way into it and have found no major problems with it yet.

Special thanks to Junilu, that code you posted was exactly what was needed to make the "Spring in Action" sample "hello world" code work. I do like the text of "Spring in Action", but I'm going to be very careful of the code.

Thanks again to all
Shaila Goyal
Greenhorn

Joined: Apr 26, 2006
Posts: 16
Hi Junilu,
I've added Spring.jar and commons-logging.jar to th lib folder but when i'm trying to compile the code which you've posted - it says 'ClassPathResource cannot be resolved to a type'.
do i need to put any other jar?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is there a good Spring book?