• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Struts Survival Guide

 
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
author
Posts: 184
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Michael Cleary
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 184
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 578
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 184
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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:
https://coderanch.com/t/47780/Struts/Justify
 
Michael Cleary
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 329
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 184
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 184
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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!
 
Michael Cleary
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 184
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic