wood burning stoves 2.0*
The moose likes Struts and the fly likes Struts Survival Guide Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts Survival Guide" Watch "Struts Survival Guide" New topic
Author

Struts Survival Guide

Michael Cleary
Ranch Hand

Joined: Jul 29, 2003
Posts: 93
As I didn't see a link to a description of the book, I was wondering how appropriate this book would be for someone who knows NOTHING about struts.

Thanks,
Mike


Mike<br />SCJP 1.4<br />----------------------------<br />mdcleary@earthlink.net<br />----------------------------<br />There are 10 types of people<br />in the world. Those that <br />understand binary, and those<br />that don't.
Srikanth Shenoy
author
Ranch Hand

Joined: Jan 24, 2004
Posts: 184
Hi Mike,
Good news for you: Struts is one of those frameworks with very less learning curve.
Actually it is for others to judge, but as the author of this book, I have written the book targetting both - beginers and experienced.
The first three chapters assume you know nothing about Struts, but have a very basic knowledge of developing web applications - You know what a JSP is and so on.
In addition to reviewers, I ran the first three chapters by a reader who knew nothing about Struts, took his suggestions to make them more understandable.
Then onwards the book picks up pace. The rest of the chapters build on what you have learnt in the first three chapters.
You can find a table of contents here: Table of Contents


Srikanth Shenoy
Author of Struts Survival Guide : Basics to Best Practices
Michael Cleary
Ranch Hand

Joined: Jul 29, 2003
Posts: 93
Excellent - thanks! It looks like it would be a good place to start for me.
I'm currently taking a J2EE programming course, and to date we have covered servlets, JSP and have just started Java Beans. As I see a lot of familiar references in the TOC of your book, I was wondering what role Struts fills developing a web application.
Thanks,
Mike
Srikanth Shenoy
author
Ranch Hand

Joined: Jan 24, 2004
Posts: 184
When developing a web application there is always a need for some generic code that acts as the controller.
You have two options - build your own v/s use off the shelf.
With the build your own, you will be reinventing the wheel by setting up a MVC controller, that becomes a fat-controller and then goes thru refactoring cycle to make a configurable controller (based on external file).
Guess what? In the simplest terms, Struts is a framework that provides configurable MVC controller at its core.
Hari Vignesh Padmanaban
Ranch Hand

Joined: Oct 07, 2003
Posts: 578
Hi Srikanth,
Actually it is for others to judge, but as the author of this book, I have written the book targetting both - beginers and experienced

I am a beginner in struts and had the same question. Thanks for the detailed reply.
Looking forward to read the book
Dany Thivierge
Greenhorn

Joined: Jun 21, 2002
Posts: 6
Hi Srikanth,
I've been using Struts for a year now, never build an web application from scratch, always maintain and develop new content to it.
My question is: Is this book going to tell me more about tweaking performance and improoving realibility or is it just for beginner and will not cover advance struts application?
I use BEA 6.1 (not in progress of converting to 8.1) with struts and it's great, I look for a good book that will not only been there for me at the begining of the learning process.
Thanks for taking time to help us understand this great framework.
Srikanth Shenoy
author
Ranch Hand

Joined: Jan 24, 2004
Posts: 184
Dany,
The book is targeted to both audience - beginner and advanced.
Since you are experienced Struts developers, the initial three chapters of my book dont have any value for you.
Other chapters will hold some or a lot of value to you depending on your level of expertise.
There is also no coverage of performance in my book.
However you might find some strategies to improve the reliability of your application using the exception handling mechanism that I discuss in the book.
You will be able to reduce the maintenance overhead of your applications by adopting techniques such as generic way to handle duplicate form submissions, editing list forms and refactoring your existing application.
For a complete list, look at the following post:
http://www.coderanch.com/t/47780/Struts/Justify
Michael Cleary
Ranch Hand

Joined: Jul 29, 2003
Posts: 93
To further demonstrate my inexperience:
- is an MVC controller similar in any way to using a front controller architecture with servlets?
- what is a fat-controller?
I think I need to read this book....
Thanks,
Mike
Ken Boyd
Ranch Hand

Joined: Dec 10, 2003
Posts: 329
What I thought "fat controller means" I might be wrong or not 100% correct.

JSP
----
to
--------
Servlets
to
--------
db or server
Let me explain you what I mean. You have a application to upload images to db or server & retrieve it for user to verify that they uploaded correct image.
1. You have JSP page with HTML field & you provide "Browse" functionality. File dialog window open & you select image file from your hard disk.
2. You might check for front end side validation like is it bmp or gif or jpg by knowing extension of filename
3. Everything on client side looks valid. Now send this mime type form via POST method to Servlets.
4. In doPost() method of Servlets you get all binary data & other form related data too.
A. First you have to check file size, if 0 byte send error message back to user.
B. If file size is correct & within (if any) process binary data.
5. You can save binary data in CLOB column of database or just save file on server directory & store path name in database column for reference.
I have done this using Servlets & it is kind of home made application where everything has to be tune according to requirement or you can say make it more robust i.e. called "fat controller"
But Strut provide you many thing built in which avoids basic checks & many more server side java classes to process you image file in conjunction with main controller Servlets.
Hope this help.
Srikanth Shenoy please let me know your views.


SCJP, SCWCD, SCBCD, SCJD, BB Java2 and JSP1.1
Jorge Blaz
Ranch Hand

Joined: Jan 31, 2004
Posts: 53
Mr. Srikanth Shenoy,
I've read the table of contents of your book and I've seen it covers Struts 1.1 with new elements like DynaActionForms.
My questions is if the book cover topics like migrating from Struts 1.0 to Struts 1.1 and differences between 1.0 and 1.1 versions?
Thanks in advance
Jorge
Srikanth Shenoy
author
Ranch Hand

Joined: Jan 24, 2004
Posts: 184
Originally posted by Jorge Blaz:
Mr. Srikanth Shenoy,
I've read the table of contents of your book and I've seen it covers Struts 1.1 with new elements like DynaActionForms.
My questions is if the book cover topics like migrating from Struts 1.0 to Struts 1.1 and differences between 1.0 and 1.1 versions?
Thanks in advance
Jorge

Jorge,
The book does not cover migration Strategy from 1.0 to 1.1
Coming to think of it, I should have included it on the first place.
It would have been (in)valuable !!
Having done the migration, I think I will roll out a document regarding gotchas on the way. I will post the link to that document here in a week or so.
Srikanth Shenoy
author
Ranch Hand

Joined: Jan 24, 2004
Posts: 184
Michael,
MVC controller is exactly the Front controller. Different names...
Regarding the Fat Controller - Well, its not a industry standard terminology. So it's pretty easy to have different interpretations.
My meaning of the word fat controller was this: Suppose you dont use Struts or any similar framework. The you would roll your own controller. Now the controller would have a mammoth switch-case of if else blocks to handle every url navigations and form submissions making it a frankenstein - both in terms of size and maintenance.
Michael Cleary
Ranch Hand

Joined: Jul 29, 2003
Posts: 93
Thanks - it makes sense to me now. Although in the case of our current project in my J2EE programming class, our front controller is very small, and basically never changes. It is the only servlet in the application and it's main function is to pass all requests to a "Handler Manager" which then decides which "handler" to pass the request on to. In our case, the handler manager contains the block of "else if" statements. However it could be implemented using a hash table instead. Of course our web application is pretty small. Anyway, enough of that....
Struts sounds like an interesting alternative that I need to learn more about!
Thanks again,
Mike
Ko Ko Naing
Ranch Hand

Joined: Jun 08, 2002
Posts: 3178
Originally posted by Michael Cleary:
It is the only servlet in the application and it's main function is to pass all requests to a "Handler Manager" which then decides which "handler" to pass the request on to.
Struts sounds like an interesting alternative that I need to learn more about!

Are you kidding? The whole web app is running with only one servlet. Are you applying Model 1 Architecture, using JSPs to deal with database and resources?
I think it'll be very suitable, if you can follow up the concept of using struts and apply to your web app... Distributing many servlets to handle their specific tasks will be better and you will see it in the Struts... Then since Struts Survival Guide is also suitable for Struts beginners, the book is for you!


Co-author of SCMAD Exam Guide, Author of JMADPlus
SCJP1.2, CCNA, SCWCD1.4, SCBCD1.3, SCMAD1.0, SCJA1.0, SCJP6.0
Michael Cleary
Ranch Hand

Joined: Jul 29, 2003
Posts: 93
Nope, not kidding - just one servlet. And we are using a Model 2 architecture - the handlers take care of logic and data manipulation, and we've just started adding JSP for presentation. Database manipulation is handled via DOA. Don't forget, this is a project for a programming class, so we add/change stuff as we go along. We've just started Java Beans, and from there move on to custom tags and EJB. No Struts for us I guess, at least in this course.
Gonna get the book for sure.
Thanks all,
Mike
Dany Thivierge
Greenhorn

Joined: Jun 21, 2002
Posts: 6
Thanks for the quick answer Srikanth,
I've just review the TOC, seems like it will cover a lot of things for just under 300 pages... I may have to look closely at that book (for the next struts book to get)
Not sure it's an exrecice you want to take but it could be fun, can you compare your book with the other best books out there about struts?
Books Like:
Struts in Action: A Practical Guide to the Leading Java Web Framework -- by Ted Husted
The Struts Framework: Practical Guide for Java Programmers
by Sue Spielman
Pro Struts Applications: Building Web Sites with Struts, Object-Relational Bridge, Lucene, and Velocity
by John Carnell
Thanks again.
Jeremy Davis
Greenhorn

Joined: Feb 07, 2003
Posts: 17
Srikanth,
I noticed in your TOC post that you include a crash course on JSTL. I've been using Struts for a year or so but have no experience with JSTL. I've heard opinions that JSTL will eventually replace Struts, and was wondering what your opinion was on the future of these two frameworks.
Sincerely,
Jeremy
Srikanth Shenoy
author
Ranch Hand

Joined: Jan 24, 2004
Posts: 184
Originally posted by Jeremy Davis:
Srikanth,
I noticed in your TOC post that you include a crash course on JSTL. I've been using Struts for a year or so but have no experience with JSTL. I've heard opinions that JSTL will eventually replace Struts, and was wondering what your opinion was on the future of these two frameworks.
Sincerely,
Jeremy

Jeremy,
JSTL provides replacements for most of Logic and Bean Tags, but not for HTML tags (and it never will - since HTML tags will remain coupled to the web controller).
This is where Struts-EL comes into picture.
Check this page: http://jakarta.apache.org/struts/faqs/struts-el.html
It should give you a clear picture of what tags in Struts will be obsoleted by JSTL.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts Survival Guide
 
Similar Threads
i love struts
Suggest a book
Strust survival guide, is it for me?
This weeks giveaway
Pro Jakarta Struts - Is it helpful for beginners?