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

Struts Kick Start 134

Simon P. Chappell writes "I started learning how to use the Struts framework in late in 2001, after I became fed-up with hacking web applications together with the digital equivalent of "Duct-tape Engineering". At that time there were no books available for the budding Struts developer, "Read The Fine Manual" was not an option ... you read the website, you read the code or you asked questions on the mailing list. This situation finally changed this fall with the release of a flurry of titles dedicated to Struts. I present here my thoughts on one of the latest: "Struts Kick Start". The rest of Simon's review follows.
Struts Kick Start
author James Turner and Kevin Bedell
pages 481 (29 page index)
publisher Sams
rating 9
reviewer Simon P. Chappell
ISBN 0672324725
summary You need this book

What is Struts?

Struts is a framework for developing web applications. It is a distilation of the current set of known best practices into a working code set that can be extended to meet almost any web application requirements. It part of the Jakarta Project at the Apache Software Foundation.

What do I know about Struts?

I have been developing web applications, using Java, for four years and using struts for over a year, and am a regular participant on the Struts mailing list. I was also a technical reviewer for one of the other Struts Books released this fall and was recently invited to speak at the University of Wisconsin, Eau Claire on the use of Struts.

What's good about this book?

There are many excellent things that I could point to. I particularly like the obvious depth of research that accompanies this book. There is a very interesting history of the development of the MVC design pattern and they even name the inventor. Do you know who invented MVC? If you want to know, buy the book! The chapters cover everything that you will need to know, in the order you are most likely to need to know it. There's even a chapter explaining the "struts-config.xml" file's DTD! (You may want to skip that on the first few readings :-)

There is good coverage of the Struts taglibs. I see a lot of questions about these on the mailing lists, so this information is very timely and it looks very well explained.

I like the coverage of other open source tools that work well with Struts. This is an important point because Struts does not do everything for you (by design), so there will be areas that will benefit from other tools. I'm looking forward to trying out some of their recommendations and easing my own Struts development lifecycles.

What's not so good?

Just one niggle, and it's more of a programming style issue, but in their example code they have references to their business objects. They explain that it is important to separate out business logic from action logic, which it is, but then proceed to use their business object within the action.

Now, I realise that example code is not the same thing as robust, production-ready code, but when people are first learning a language or framework, they tend to copy exactly what they see in the book they are learning from. Even though example code should be light on error checking, it should be heavy on correctness and good style.

Should you rush out and buy it?

If you are about to use Struts on a project, are new to Struts and need dead tree documentation for those RTFM moments or are evaluating Struts for future projects, then you absolutely need this book.

If you are an intermediate Struts user, then this book would still be very useful to you and I can certainly recommend it.

If you are an experienced Struts user, then you've almost certainly exchanged emails with James or Kevin, on the Struts mailing list, so you can make your own mind up!

Table of Contents

  1. Struts in Context
  2. The Model-View-Controller Design Pattern
  3. Hello World!
  4. HTTP Protocol
  5. JSP, Taglibs and JSTL
  6. The Sample Application
  7. View Components
  8. The Controller
  9. Model Components
  10. The struts-config.xml File
  11. How the Struts Tag Libraries Work
  12. Struts HTML Tags
  13. Struts Bean Tags
  14. Struts Logic Tags
  15. The Nested and Template Struts Tag Libraries
  16. The Struts Tiles Tag Library
  17. DynaForms and the Validator
  18. Using Struts with Enterprise Java Beans
  19. Using Struts with Web Services
  20. Building, Deploying and Testing Struts Applications


You can purchase Struts Kick Start from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

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

Struts Kick Start

Comments Filter:
  • Re:Struts? (Score:3, Interesting)

    by MaxwellStreet ( 148915 ) on Tuesday December 31, 2002 @12:45PM (#4988766)
    hehe . . .

    Not sure if this is a troll, or intended to be funny . . . but it works on both levels I suppose.

    Anyhow, I've been using Struts for about a month refactoring a largish internal Oracle PL/SQL web app, and the MVC separation that's enforced by the Struts framework is really just what the doctor ordered. I'm getting similar functionality in roughly 20% of the comparable lines of code; and this is early enough in the project to where code reuse hasn't even come into play much. I'd imagine it'll end up at about 15% - i.e., 150K LOC using struts as opposed to about a million LOC using PL/SQL.

    I know Lines of Code isn't necessarily a good measure of just about anything - but the real benefit is maintainability and ease of expansion (which is what brought on this refactoring to begin with).

    Struts is really worth a long hard look - gets you away from using the technologies above and into a real enterprise-class web application structure.
  • by Anonymous Coward on Tuesday December 31, 2002 @12:55PM (#4988846)
    Don't get me wrong, Struts is great and I am currently using it in my applications... But, I have to ask, what the big friggin' deal with struts - why all the hype...

    Strust is just an implementation of what has already been developed by several companies - I will use Apple as an example. The same sort of thing is done with WebObjects in that the HTML from end and back end Java (or Obj-C) is linked with the need to create any real glue to connect them - it just sort of does it for you - with a nice IDE I might add.

    WebObjects (like Struts) allows a developer to connect front end HTML to a server and pass data back and forth so that it's easier to deal with on the server...

    Okay so why the rant? Well do you really hear about WebObjects being used all that much, NO! The reason (outside of the fact that when it was a NeXT product it use to cost a forture) it that the learning curve is wicked steep. That is where I see Strust going, it's a great technology, can do all sorts of cool stuff, will ease development but requires some time to get ones head around how it works.

    I have seen more than a few projects that claim they use Strust when in fact they use maybe 5% of Strust and still need to use code to glue the front and middle tiers together. It's a real shame that we do not have really nice editor integration - ya ya, I know a few editors have the integration but face it folks, they all suck.

    What we need is one of the big guns to step up to the plate and really integrate (and support) struts integration *wink wink* Borland...

    Just my .02
  • What's not so good? (Score:3, Interesting)

    by Brummund ( 447393 ) on Tuesday December 31, 2002 @01:22PM (#4989070)
    Just one niggle, and it's more of a programming style issue, but in their example code they have references to their business objects. They explain that it is important to separate out business logic from action logic, which it is, but then proceed to use their business object within the action.



    Hm. I'm not quite sure I follow you here. I haven't read the book, only your review, and I'm a bit puzzled by your statement regarding business objects in actions.


    Is it so that the example code for the actions contain business logic directly, or do they use business objects without wrapping them in controllers (like a session bean)


    If they're using session beans or controllers in the actions, I can perfectly understand that. You have to use the business logic somewhere. :-)


    On my current project, we have a (yuck) flash-client (using macromedia's Flash Remoting MX, btw. nice thing, saves a lot of time usually spent on devicing your own xml-based protocol to communicate with the flash client) . The flash client accesses a standard java class/bean. This bean contains code to massage the output from a session bean to simple data structures more suitable for a flash client (and programmer. Ok, low blow. :-)


    The session bean acts as an facade to all the functionality required by/provided to the client (authentication, fetching and updating data etc.) The system has about 10 session beans and quite a few entities.


    We've used this approach before, and when we had to add some new types of clients, we only have to add a bean convert to/from client requests and the controller (session bean).
    (At first, we only developed a Flash client. Later, we added a SMS client and a web client.)

  • Struts ported to PHP (Score:2, Interesting)

    by tetranz ( 446973 ) on Tuesday December 31, 2002 @02:55PM (#4989728)
    Phrame [ttu.edu]
  • by mr.buddylee ( 541034 ) <brad@pob s . cc> on Tuesday December 31, 2002 @03:04PM (#4989806)
    I personnally think Struts makes things harder. I haven't gotten into it a lot, but it seems to take me a whole lot longer to get a project done with struts than if I just used scriplet code. The only reason I use it is because I have to, I sure wouldn't us it if I had a choice. It's limiting in what you can do, and the ways you can do it, there was little to no documentation (until now I suppose), and it's just confusing. I'll admit that I'm a novice JAVA programmer, but seriously, why use a tool that makes things more difficult. It's just a tool to use until the next big thing is pushed out by a group of programmers with too much time on their hands.

You knew the job was dangerous when you took it, Fred. -- Superchicken

Working...