Struts Survival Guide
Even before I started reading the book, the fact that stood out most was its pricing. The book costs $14.95, and is great buy for everybody and especially students. The book is light -- just 224 pages -- and is an easy read. The authors' style is neither dry nor humorous, but very convincing and developer friendly. Bottom line: It does not put you to sleep.
There are two aspects to any framework: the first aspect is the features of the framework itself; the second aspect is how easy it is to use them effectively. This book does justice to both aspects of Struts. It covers enough framework features to justify its title, starting from bare bones and then slowly guiding you to more advanced topics. In addition, there are chapters dedicated to dealing with variety of scenarios in web applications where Struts can be used to solve the problems effectively. This is the area where the book shines.
Chapter-wise reviews The book starts off with an excellent introduction to MVC and how Struts fits into MVC. It then explains the basics of Struts very well and develops a hands-on application in Struts in the first three chapters.
The fun starts from Chapter 4 onwards. Chapter 4 covers advanced Struts concepts and presents some interesting ideas about Struts Action design. Of particular interest are the coverage of how to protect your JSPs from direct access, using SwitchAction to navigate between multiple Struts modules. The different mechanisms of Action chaining and scenarios where Action chaining is not recommended is also an enlightening read. One of the controversial points in the book is that author discourages you from using XDoclet and explains why XDoclet is not a great idea with Struts.
Chapter 5 covers the validation in Struts. It is the shortest write up on Validation I have ever read and yet it beautifully explains the Commons Validator and its integration with Struts. In the context of validation, the author also explains when to use DynaActionForm and its derivatives and when not to.
Chapter 6 deals with Struts Tags. Reading this chapter was such a refresher. Other books on Struts have bored me with details of each attribute of each tag in Struts. I find this approach non-intuitive since that information is supposed to be a cross-reference and available on Struts web site anyway. Not so with this book. This book takes the approach of explaining the basic tags by example. In chapter 6, the author dives straight into practical aspects of building web applications with Struts. One of the very first illustration is why and how to modify BaseTag (the one that renders ) to suit the real life deployment scenarios. Next the chapter takes up one of the serious issues with check boxes regarding their state and provides a solution. The chapter provides technique for seamlessly integrating JavaScript validations with Struts validation. A lot of Struts web application that we develop do not use plain buttons. Instead image buttons are used. Perhaps the author was very aware of this fact and the lack of support for image based form submissions in Struts. That is why the chapter and the book has frequent references and solutions for dealing with Image buttons. It all starts in this chapter with a great introduction and some classes that make the form submission on the JSP transparent to the Action classes.
The Chapter 6 provides little details on the Struts Bean tag library except for dealing with multiple resource bundles and some design tips. Perhaps the reason is that the bean tags are so straight forward and covered well in the Struts web site. Another highlight of the chapter is a short yet great coverage of JSTL as a background for Struts-EL. The JSTL is introduced in the context of Struts Logic tags as a solution to deal with convoluted and and confusing nested tags. The section on Struts-EL is really short and could have been more.
The creme la creme of Chapter 6 is the section on dealing with List Forms. Sometimes you often have to deal with Forms with collection, edit the collection or delete the collection. Developers are confused on this topic as is evident from the postings in Struts mailing lists. The author does a great job of resolving the mystery surrounding editable collections in Forms. The author also does a great job of integrating the Pager Taglib from JSPTags.com with Struts and how a high performance page traversal mechanism can be set up based on the ValueListIterator pattern (Core J2EE Pattern) and database specific mechanisms.
Chapter 7 is a very decent way to learn Tiles. Tiles can be very confusing due to its capability to achieve the same thing in numerous ways. The author sticks to just one approach of using Tiles with Struts and defends why that is the best approach. The pros of this approach are there are confusions and the learning curve with Tiles is flattened. Coverage of Tiles Controller is missing and is desirable.
Chapter 9 on Exception handling in Struts deserves some mention. It is one of the best exception handling chapters I have ever read. Most other books on Struts limit their exception chapter to explaining differences between Checked v/s Unchecked exceptions and telling how the tags work in the struts-config.xml. The coverage of Exception handling in this book alone is worth the price of the book. It provides a solid framework to handle Exceptions in Struts, log them in a centralized manner and report and alert in a production environment.
Chapter 10 is for folks who want to customize Struts and reap its benefits in design and development of production systems. It presents four examples of how Struts can be effectively customized. The best among them was how to how to handle duplicate form submissions in a generic manner. We all have to deal with duplicate form submissions in daily life and handle them on use case basis by using the Synchronizer tokens. The technique illustrated here no doubt relies on the Sync token but uses it a very ingenious manner, presents a generic Action class. I liked this technique. Other techniques I liked are that the chapter provides a Dispatch Action like functionality for Image based form submission. The DispatchAction in Struts is great, unfortunately I can use it only under certain restrictions. One of them is that the all of the buttons have to have the same name. This technique removes that restriction and opens a world of possibilities for designing cleaner applications while providing enhanced user experience.
If there is a feature in Struts which is not the best way to attack a problem, this book tells you that. The chapters are also interspersed with design tips for designing your Struts application better. In summary, this is a pragmatic Struts book and a highly recommended read for developers and architects already familiar with Struts. You will certainly pick up quite a bit of Struts tricks that will help you design better Struts applications. If you architect, design and develop Struts based applications for your living, do yourself a favor - Go buy this book. Even if you don't know Struts, you can learn it fast with this book. The only requirement is that you should already know the basics of how to develop J2EE web applications.
You can purchase Struts Survival Guide: Basics to Best Practices from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
web applications created with struts are slow and memory hogs... you end up creating tons of objects even when you are doing something simple. It's really an OO academic exercise.
love is just extroverted narcissism
Suck a Boot!
For my ferst poste.
OMG MY FIRST FP!
Fifth post!
"jakarta"
great, more jobs going away.
when will we wake up and bomb India and other useless nations back into the stone age?
Here's a better struts survival guide:) (Sorry for the flamebait, I've been having another frustrating day developing a struts application...)
there's always an easy way to get your app up and running before the deadline slips
Gentoo Linux's lead developer Daniel Robbins is a cold-blooded killer! Maybe this is why he left Gentoo, because he's facing 50 years of hard time?
Then I found this book. I devoured this book in its entirety in a week. Now, I not only know the basics of Struts, but also understand best practices and Strategies in Struts. Lucid presentation, Easy read and great stuff. A very practical book. I already find myself using the code from this book in my current project. And my co-workers think I am a smart Struts geek !
ne more crippling bombshell hit the already beleaguered Novell community when IDC confirmed that Netware
market share has dropped yet again, now down to less than a fraction of 1 percent of
all servers. Coming on the heels of a recent Netcraft survey which plainly states
that Netware has lost more market share, this news serves to reinforce what we've
known all along. Novell is collapsing in complete disarray, as fittingly exemplified by
failing dead last in
the recent Sys Admin comprehensive networking test.
You don't need to be a Kreskin to predict
Novell's future. The hand writing is on the wall: Novell faces a bleak future. In fact there won't
be any future at all for Novell because Netware is dying. Things are looking very bad for Novell. As
many of us are already aware, Netware continues to lose market share. Red ink flows like a river of blood.
Corel Netware is the most endangered of them all, having lost 93% of its core developers. The
sudden and unpleasant departures of long time Corel developers Jordan Hubbard and Mike Smith
only serve to underscore the point more clearly. There can no longer be any doubt: Netware is dying.
Let's keep to the facts and look at the numbers.
Netware Admin leader Theo states that there are 7000 users of Netware Admin. How many users of ConsoleOne
are there? Let's see. The number of Netware Admin versus ConsoleOne posts on Usenet is roughly in ratio
of 5 to 1. Therefore there are about 7000/5 = 1400 ConsoleOne users. Corel Netware posts on Usenet are
about half of the volume of ConsoleOne posts. Therefore there are about 700 users of Corel Netware. A
recent article put Novell Netware at about 80 percent of the Netware market. Therefore there are (7000+1400+700)*4 =
36400 Netware users. This is consistent with the number of Netware Usenet posts.
Due to the troubles of Word Perfect, abysmal sales and so on, Corel is going out
of business and will probably be taken over by Novell who sell another troubled OS. Now Novell
is also dead, its corpse turned over to yet another charnel house.
All major surveys show that Netware has steadily declined in market share. Novell is very sick and
its long term survival prospects are very dim. If Netware is to survive at all it will
be among OS dilettante dabblers. Netware continues to decay. Nothing short of a miracle could
save it at this point in time. For all practical purposes, Netware is dead.
One thing that I'd be sure to look for in a Struts book is a section on how to correctly use the word Struts in a sentence of English language.
The issue here is that in some respects, 'Struts' is a singular noun referring to a framework - yet it ends with an 's' tricking many English-As-A-Second-Language-IT-Professionals into thinking that they need to apply rules of plural nouns. In extreme cases, I've heard people take the liberty of removing the 's' completely! as in:
"We will update the Action class of the Strut."
Maybe - just maybe - there is still some hope.
The owls are not what they seem
Is that what holds up the Petronas Towers?
Struts is such a big over-engineered pile of shit..
is used to describe the stiff legged, uncomfortable walk of a man in the waiting room of the free clinic, his penis belching what feels like liquid fire, after a trip to "exotic" Indonesia.
I don't need no instructions to know how to rock!!!!
gawker At most Of its core profits without of businees and was
Anyone know how Struts compares to Maypole, a Perl-based MVC? I just started reading up on MVCs, and Maypole claims decent functionality can be achieved with as little as 10-20 lines of coding.
Also, while I'm thinking of it, does anyone know of a decent Python-based MVC?
*** This thread is marked as CLOSED ***
*** Please move on to another topic ***
Come one people, feed the troll, feed the troll!
who out of the corner of their eye, read :
Sluts Survival Guide
PC moderators can suck my White pierced, tattooed dick. If you think pride == hate, s/dick/Aryan meat mallet/g.
It usually takes less time to develop you own framework than to learn Struts, J2EE, etc...
Here a quick tip for a simple cluster. Use JMS or another queued message pool. Start as many servers as you need, and let each message be handled by whichever server is available. I was doing this in java in '97 and I still haven't seen a framework that beats it in performance, ease of use, or versatility.
Complicated problems require complicated solutions. Simple problems require php, asp, or coldfusion. Most problems are simple. Use the right tool for the job, but don't complain if the right tool is hard to use. It's hard to use because it does something.
[This sig left intentionally blank.]
Why is mixing Java-code and markup a downside?
... you can just add an offset in the loop and pass it in the url or something like that.... It's done in 15 minutes...try that with your struts and tapestry stuff......
When using struts you have some kind of XML-document in which you cannot see the difference between controll-statements (logic) and markup because it's all in the same format.
That's unreadable and unmaintainable.
The problem with stuff like struts, velocity, cocoon, tapestry etc. is that you have to change stuff in multiple files to change simple behavior.
For instance;
If you have a page with a table of 34983 rows, and you want to split them ("go to next 100 results") in chunks and you created your page with all those fancy framework you have to change stuff in different-files, you have to create a new 'tag' and perhaps you have to "deploy" or what-ever....It's just not maintainable.
In a simple JSP with a for-loop (just java-code) and an iteration which prints a
:wq!
I used struts for a short while on a previous project, it seems to have gotten a little bloated recently though.
A framework I am working with currently is spring.
Spring is a superb framework for Java development and includes a pretty impressive MVC web toolkit as well as many other tools and features. The AOP stuff is very nice and the whole inversion of control/dependancy injection implementation simplifies code drastically.
Ive used quite a few different frameworks, but so far... this one is my favourite.
If you are starting on a new java web app i'd recommend picking up one of the next-generation mvc frameworks be it Webwork2, Tapestry, Spring-MVC, Maverick or JPublish, these are all much better than Struts
Agreed that Struts sucks.
However, try this:
Create your table as you explained.
Now create your table using a tag library.
Now do it on 25 different pages in your website.
1. The inclusion of a tag that does this (like JSTL for loops) is more readable, and easier to understand for presentation people that don't know Java.
2. The code is in one place (the tag library) and doesn't need to be copy-pasted 25 different places, and become a mainenance nightmare if something changes...
Raw Java code in JSP pages should be avoided, as it sucks.
Struts sucks too - too many configuration files. Way too complicated for what it is. JSF looks like it may be a step in the right direction... but not enough.
For instance;
If you have a page with a table of 34983 rows, and you want to split them ("go to next 100 results") in chunks and you created your page with all those fancy framework you have to change stuff in different-files, you have to create a new 'tag' and perhaps you have to "deploy" or what-ever....It's just not maintainable.
But say you wanted to do that several times over different tables with different size results. If you embed a java for loop in your JSP to accomplish this, you have to basically copy and paste your code where ever you want to repeat this behavior.
Tags allow reuse. Copy-and-paste is not reuse.
The problem with scriptlets is that they are so easy to use. They are great for prototyping but, as is often the case in software, prototypes soon become production applications.
Poor Man's WebObjects.
MVC for J2EE via WOF is what you want, but if you want Linux than one can see the popularity of Struts and other MVC frameworks on none Apple supported platforms.
Apache Cocoon2 Frameworks are much more interesting than Struts, personally.
I know that most of you won't agree with me, but after developing applications in both environments it is clear that asp.net is better than struts in many ways. Of course, it should be seeing as how MS pretty much ripped it off and added to it. The people who make the struts framework have some catch up to do to be on par with what is coming from MS in their next version.
is one config file that hard? or 2 if you include web.xml.
i maintain a very large struts application and struts has made everything maintainable.
PHP is the solution of choice for relaying mysql errors to web users.
We have four mid-size/large apps developed with Struts and this framework saved us a lot of grief. There are plenty of books devoted to Struts, not sure if this one is the best (I personally like one by Chuck Cavaness) but it's good to see that Struts gets the attention it deserves.
Yeah right.... So, in your opinion I have to create a tag instead of a simple for-loop (that anyone can read) because I may not copy-paste a for-loop. Every structured program contains loops and stuff (Dijkstra), so why should we add another custom abstraction layer, and (and that's the other downside) a new scope?
:wq!
I agree with you that Velocity is the way to go for Java web applications. We use Velocity instead of JSP for the web presentation layer.
Velocity also excels at being a general purpose templating language - sure, JSP Expression Language gives you some of what Velocity does, but you can use Velocity to process any text, anywhere in a Java application.
Tips and Tricks for Mozilla
There is really only one solution, "Fireant".
This is the book is the essential career survival guide for Struts and J2EE developers.
Www.anti-slash.org more stable things in Distribution make OF AMERICA irc and Juliet 40,000 demisE. You don't arseholes at Walnut
.. once I discovered echo and echopoint
I haven't looked back since.
To sum echo up:
Write web applications using a swing like API.
-- MartinG To mail me: echo kewyjlcxyzvjfxbqwh | tr bcefhjklqvwxyz
Anyone read both this one and Struts in Action?
If so how do the two compare - is either one better than the other?
ffel obligated to is not prone to we all know,
It feels slashdotted even without being actually slashdotted.
Fundamentally, Struts is a refactoring of the basic servlet API, but is still intrinsically operation-based (as are pure servlets).
WebObjects, and it's thematic successor Tapestry are component based approaches, an entirely different mindset. I created Tapestry and I have about two years of Struts experience ... Struts is a straight-jacket. Component frameworks offer incredible advantages in terms of clarity and developer productivity. Struts offers very, very little except a slew of books that have the daunting task of explaining in detail something that should be (was intended to be) very simple.
Howard M. Lewis Ship -- Independent J2EE / Open-Source Java Consultant -- Creator, Apache Tapestry and HiveMind
shout the loudest happen. 'At least inventing excuse5 found out about the
The inventor of Struts has moved on and has been working with Sun to produce a new and more versatile framework called Java Server Faces:
http://java.sun.com/j2ee/javaserverfaces/
This is the framework that is being adopted by all major java IDE designers: NetBeans, Borland, Oracle etc. Fortunately, its not difficult to integrate struts and JSF, but for newer projects, JSF makes sense. It has an advantage in that the GUI doesn't have to be web pages - you will be able to 'plug in' WAP, Swing etc.
I have been using Struts for over a year now, and although I'm over the steep learning curve, I can't help but think there's something simpler.
Some have mentionned Spring, and I'd love it if anyone here could tell me how that compares to Struts, especially if they tried OpenSymphony's XWork or Webwork.
Any recommendations?
Information: "I want to be anthropomorphized"
I frankly wasn't all that excited about struts. ... so even if the idea itself wasn't bad to begin with, it will turn to crap once
What pisses me off is that whenever
the apache project approves an idea,
no matter how crappy, it gets a TON
of attention
it becomes part of the apache project
don't get me wrong, the apache project has tons of great software, I just don't think struts is one of them
In this case, you are not tagging the for loop. You are tagging a specific browsing behavior(view N things at a time). And even if it were a simple for loop, using tags instead of scriptlets exposes iteration variables that other tags might want to use whereas you cannot easily get at local scriptlet variables.
My point is tags are a good thing and should be used when possible. Scriptlets are the main reason people say "JSP sucks cause you can still embed Java in your HTML". Tags encourage reuse. Scriptlets encourage haters
Using tags is the same as indirectly embedding java in your HTML. The only difference is that you have to open more files (an XML-configuration, a java-class) to see what it's behavior is. When using just java embedded in your HTML you have everything in just one file.
:) And when using tags you also
Be honest, moving a so called scriptlet to a class, writing a descriptor-file and add some
new syntax (a new tag) to the mark-up-language
is a lot of work. A simple piece of java-code is easier to maintain than all this framework-stuff,
just because it's less code.
Adding some simple functionality is a lot of
work.
And what 's the difference between:
<%=this.is.my.Tag.getHTML()%>
and some fancy XML-syntax!?
Isn't <%xyzzy%> xml-compliant?
When re-use is an issue, you can always use jsp-includes
copy/paste the calls to the tags.
Do PHP-taglibs including XML-config exist?
:wq!
Heh. For the project I'm developing now with Struts I already replaced JSP with Velocity. Much more readable, much easier to write. Also I don't need a fancy web-server (read- caucho resin) to run it fast, Tomcat does the job quite well.
And as for other projects, well, i have my own framework that's WAY better than struts (also using Velocity), and I use it whenever I work with a smaller team that isn't afraid to learn something new. I hope to open source it one day, but well, now it is too far from being in the state where I could put it on sourceforge.
--Coder
Heh, 2 years ago we rewrote a major web application of our company (www.cv.lt) from scrach. We've been happy after that. It was written in coldfusion (on mysql), and it was crap. Way too many problems with no way to fix them, problems with coldfusion server crashing under linux under high loads and so on and so on. Now it's written with java/struts/postgresql.
--Coder
I don't usually try and post the same thing a second time to try and get modded up, but the 'Informative' parent post is simply factually incorrect. I am not confused at all. The situation is very clear: JSF is a full replacement for struts at all levels, Model, View and Controller. You are confusing the presentation tags of JSF with JSF as a whole.
A direct quote from the author of struts:
"JSF provides functionality that overlaps that
of Struts (my misconception was that JSF was strictly a UI component tag library)."
You have the same misconception.
unreadable because it looks like a mark-up tag.
<%for (int i=0;i<234984;i++){%>
<tr> blahblah </tr>
<%}%>
Is more readable. The separators are there to alarm the web-design people; "please do not touch this".
2. bullshit; as I said before. When using a plain for-loop you "copy-paste" a decent flow construction. That's no reason; it implies that almost any program is copy-paste-bloatware. When using some kind of tag-lib you copy-paste a flow construction which looks like a markup-tag PLUS you use YAFEFBS (yet another fancy enterprise framework business solution). A web-designer can fuck it up easily by accident. When a programmer needs to change the behavior, he has to dive into the configuration, edit a java-class, compile it and even deploy it, restart an application-server.
And about the 25 different pages; you just should not create 25 different pages if they all contain the same the stuff...
You state that struts sucks because of too many configuration files. You also state that 'raw java' should be avoided, because it sucks. Is that a reason? Why does that suck? I gave a good reason why it does not suck: you can easily distinguish flow control and logic from markup.
The whole problem is the browser. It was never meant for interactive applications. People just started to miss-use HTML: table-tags for doing layout, forms for emulation of normal GUI's etc.
Stuff like all MVC-frameworks just simulate a normal way of programming, but at the end you just have to spit out some HTML which is static and then you do not have control anymore and the simulation ends.
Customers always want fancy interactive applications running in a browser (don't ask me why) so you always have to hack stuff with java-script, pass parameters in the URL to get things working etc...etc... With a framework like struts, JSF or tapestry in between, it's a whole lot of work to just add some simple stuff:
Customer: "I want a help-button in the table-header on screen 1,4,25?"
struts-evangelist: "Err...Hm...I have to add a new parameter to my tag, update the descriptor-XML....hm...I need to compile and deploy the whole stuff....let me think...that's 3 hours work."
nerd: "Ah ok, let's give it a try..." [...]
3 minutes later....
nerd: "something like this?"
Customer: "Yeah! thanks! put it in production, please"
nerd does:All those fancy frameworks just don't work in the real world. Is ebay running struts? is amazon using JSF? is hotmail using tapestry? (And what about slashdot? is it running cocoon and xsl-transformations?
No way....popular, user-friendly, fast and fancy applications are just handcrafted using more flexible tools.
:wq!