As popular as the Struts Framework for building web applications with Servlets and JSPs is becoming, the online documentation is inadequate, focusing on the most basic functionality and leaving out information crucial to developers writing today's complex web applications. O'Reilly's Programming Jakarta Struts was written by Chuck Cavaness after his internet company decided to adopt the framework, then spent months really figuring out how to use it to its fullest potential. He calls the books, "the culmination of lessons learned (the hard way) while building our application."
Readers will benefit from the real-world, "this is how to do it" approach Cavaness takes to developing complex enterprise applications using Struts, and his focus on the 1.1 version of the Framework makes this the most up-to-date book available.
Full Description
Here is in south korea.This book is a school book in university.Of course,traslation edition.
but diffcult.
And korea language is not in orelly web site.
please make web site of korea version for many korean user.
Even i was having the same problem ..now i got it rectified.
First I must say that I normally love O'reilly's books. I have read lots of your books and they have always been great. That's why I bought this book without even looking for reviews. This was a huge mistake since this book is the worst book I have ever read!
The problem is that I dont understand who the book is for? It's not a book to use when you want to learn Struts since the book doesn't progress (the forth chapter is a full description of the configuration file for instance, and by then you don't have a clue what all options mean). So after reading this book I had to turn to other resources to learn how Struts really works. So it wasnt for first times, maybe it works as a reference? No, Im sorry! Chapter 8 is a good example, here the author lists some of the tags available in Struts but I don't know how these tags are selected. The form-tag is described but the text-tag isn't. What good is it to know how the form works if you dont know how to create a text field?
The reason that I write this review right now is that I just started my second project with Struts and since I had forgotten some of it since the last time I turned to this book again. After a while I was really annoyed about it and turned to the web page to see if someone else was experiencing the same problems. I was very surprised to see that the average rating was FOUR! I looked a little closer and realized that the author himself was the author of 32 reviews, and this really annoyed me!!!
My suggestion to everybody who is looking for a Struts book is, don't buy this book. My suggestion to O'reilly is, stop selling this book and write a new. This book have really damaged you reputation (at least in my company and among my friends).
Programming Jakarta Struts Review,
March 17 2004
Submitted by Eric Lewis
[
Respond |
View]
Since I want to use the Validator outside of Struts (other guys at the office are doing Struts), I tried "Using the Validator Outside of Struts" (page 279 in my edition). It all works great, but as soon as a validation goes wrong, the message resource can't be found. I get
<blockquote>
...
Caused by: java.lang.NullPointerException
at org.apache.struts.validator.Resources.getMessageResources(Resources.java:150)
at org.apache.struts.validator.Resources.getActionError(Resources.java:222)
at org.apache.struts.validator.FieldChecks.validateRequired(FieldChecks.java:130)
... 26 more
</blockquote>
The guys on the Commons Validator mailing list told me that I should write all my own stuff, which is true from their point of view. But since Struts offers so many good validators, I think it would be a lost opportunity not to use them.
So, in a nutshell: When I use Struts Validators outside of Struts, how do I specify the message resources?
Can anybody help me out? Chuck? :-)
Programming Jakarta Struts Review,
February 25 2004
Submitted by Chuck Cavaness
[
Respond |
View]
Rob,
I did find that class, but it's not being used within the Storefront app so you should be able to delete it. It was included due to me re-using a few example classes that are in the struts download and some extra ones were in the example but werent being used.
If you have the struts binary and source distribution (which you can get from the struts site), then you will probably have all of the source that wasn't included within my WAR file.
Sorry about the mistake.
Programming Jakarta Struts Review,
February 25 2004
Submitted by Robert Buick
[
Respond |
View]
Chuck,
Thanks for getting back so promptly.
There are a number of .class files in the storefront.war file under WEB-INF/classes that don't have correspending .java files (MyMessageResourceConfig.class is one of those). It would helpful to have all the correspending .java files so that my understanding of struts as applied to this application is aided and unimpeded.
Regards,
Rob Buick
Programming Jakarta Struts Review,
February 24 2004
Submitted by Chuck Cavaness
[
Respond |
View]
Rob,
I dont recognize that class as one of the ones that I created for Storefront. What package and/or directory did you find that in? What other classes are you interested in customizing?
Since Struts is open source and my stuff is through the book, you should have access to all the source files you need. Let me know what class files you need source for and Ill see what I can find out.
Programming Jakarta Struts Review,
February 24 2004
Submitted by Robert Buick
[
Respond |
View]
I have built the storefront application and looking to extending it.
I note that there are .class files without accompanying .java files e.g. MyMessageResourceConfig.class. Are these files ommitted from the source.zip file because they exist elsewhere (that I haven't stumbled across)?
Regards,
Rob Buick
Programming Jakarta Struts Review,
February 22 2004
Submitted by Deepak Verma from the Columbia Java Users Group
[
Respond |
View]
Great book on Jakarta Struts:
This book presents an explanation of Struts that is both easy to comprehend
and one that follows the design process from beginning to end. It's a
complete guide to the Struts project, taking developers through concepts,
design and implementation and explains the Model 2 design pattern in depth.
Installation and setup are thoroughly documented, and every configuration
option is clearly explained. JSP programming within the context of Struts is
explored, with tons of practical examples that use both the standard JSP tag
libraries and Struts additions. You'll also become adept at programming
multitiered applications, interacting with EJBs from struts applications,
and handling complex validation and logging through the Struts provided
packages and tools. Also covers how to create your own rules and to use it
outside of Struts.
Whether you've been struggling with Struts, or you want to get started in
Model 2 programming, or you're an advanced Struts programmer wanting to
fully exploit this powerful framework, overall I'd say this is an excellent
resource.
Programming Jakarta Struts Review,
February 02 2004
Submitted by Brian Hasslinger
[
Respond |
View]
Solid book, thank you for not having a pet store example. Please incorporate into the downloadable examples area the fix to the problem noted by Tingbin below (it works on Orion but OC4J fails):
If you run the smaple Storefront and you cannot get any item detail page. The problem is that in ItemDetail.jsp line # 69, there is a redundant paramId in that <html:link>. Simply delete that one, then you will go.
Brian
Programming Jakarta Struts Review,
January 05 2004
Submitted by Kenny
[
Respond |
View]
Mr.Cavaness,
Thank you for your reply.
Guess what? I got it working!!!
I was using Eclipse to build my Web application and that was the problem.
I didn't know that I shouldn't be putting files directly into the
WEB-INF/classes directory when building Web applications using Eclipse( and other IDEs).
I put the properties file in the WEB-INF/src directory
(Eclipse automatically copies the properties file in the WEB-INF/classes directory) and everything worked perfectly.
Programming Jakarta Struts Review,
January 04 2004
Submitted by Chuck Cavaness
[
Respond |
View]
Kenny,
Are you using a WAR file or exploded format? If you have a WAR file (without the properties file), the servlet container may be deploying the WAR each time, overwriting your file. Either remove the WAR from the deployment area, or add the properties file to the WEB-INF/classes in the WAR.
If this isn't your problem, then I'm puzzled like you probably are why this would happen. Which container are you using?
Programming Jakarta Struts Review,
January 02 2004
Submitted by kukupopo
[
Respond |
View]
Hello,
I bought the Programming Jakarta Struts published from O'Reilly
(It's pretty nice) but I am having trouble integrating
Log4j into Struts application.
Whenever I put Log4j.properties file or Log4j.xml file in the WEB-INF/classes
directory and rebuild it, the file dissapears!!!
Do you have any suggestion on how to solve this problem?
thanks in advance.
Kenny
Programming Jakarta Struts Review,
November 24 2003
Submitted by chuck cavaness
[
Respond |
View]
Simon,
Since there are several versions of Resin, I would suggest looking at their website to find the latest documentation. Here's the address in case you don't have it:
Caucho Technology - Resin
Programming Jakarta Struts Review,
November 22 2003
Submitted by Simon
[
Respond |
View]
Would you please detailed explain the purposes of resin and its config file with examples?
Regards,
Simon
Programming Jakarta Struts Review,
November 10 2003
Submitted by FLF
[
Respond |
View]
before reading your book, I read
Struts In Action (Manning). As I was immensely disappointed by my first read of
Struts In Action, I thought your book was quite good.
Now the critics:
- I think a validator reference a la struts in action at the end of the book is missing (there is none in struts documentation, so this is very useful).
- Contrary to other readers, I found your example application quite useful (especially compared to manning book). It was similar in many aspects to a problem I had to solve.
- Logging aspect should not be part of the book.
- I would have appreciated a presentation of other open source web MVC frameworks (Maverick, WebWork) and a comparison. I think any serious book on struts should present the alternatives.
- A performance chapter ! just because Struts seems to require so many objects.
Regards,
Fabien.
Programming Jakarta Struts Review,
October 30 2003
Submitted by Chuck Cavaness
[
Respond |
View]
Dan,
The Struts user group can be found at http://jakarta.apache.org/struts/using.html#Lists. I would recommend that you post your recommendations for the Struts framework there. For sure, the audience will be larger.
I am however interested in what ways the book is simplistic. I plan on a 2nd edition and am always interested in making it a better book.
chuck
Programming Jakarta Struts Review,
October 29 2003
Submitted by Dan Land
[
Respond |
View]
Book is kind of simplistic, but it reflects an 'API' that is overly complicated for what it does. Abstraction is a good thing - as long as it conceptually simplifies an interface. Struts is abstraction for the sake of abstraction. It is a complex abstraction over a set of complex APIs. It seems to me that the designers of Structs just wanted to write an abstraction layer for the sake of writing one. There are lots of complicated things that I normally program that Structs can't even begin to do. And, all the objects that Structs creates makes it perform slow.
Dan
Programming Jakarta Struts Review,
October 28 2003
Submitted by joseph
[
Respond |
View]
Hi Chuck,
Could you tell me how can I use Struts tags or other JSP tags to upload images on client side ? i.e, when the client come to the website, they can upload their images/pictures to our server.
Any suggests/solutions from others are welcome too.
Thanks a lot.
Joseph
Programming Jakarta Struts Review,
October 23 2003
Submitted by Chuck Cavaness
[
Respond |
View]
Stephen,
Thanks for your comments and you are correct. The book was released around January, which was pre GA release. Since then, the code base has undergone quite a few changes. This is one of the upsides (or downsides if you're trying to write a book on it) with open source. There is a discussion underway about updating the book (and the source for the book) based on the latest release. But as you imagine, even that will be old by several months when the book is released. It's a ugly cycle :)
Programming Jakarta Struts Review,
October 22 2003
Submitted by Stephen Henrie
[
Respond |
View]
In general, I believe the book is well written and useful to picking up the Struts framework - as long as the reader has a fairly comprehensive understanding of J2EE already.
There is a problem with the example code on the website. The banking.war.zip has an older version of the struts library in it which is incompatable with the latest struts version. I could not get the login.jsp file to compile until I updates the struts.jar file with the copy from the storefront demo. Someone may want to fix this, as it is very frustrating during the learning process to have stupid stuff like this get in the way.
Thank you.
Programming Jakarta Struts Review,
October 12 2003
Submitted by Bruce Badash
[
Respond |
View]
Great book! The one area that I'd have preferred more detail (i.e. real world examples) is in the use of the struts tag libs. Specifically, the use of the tags in an I18N context. It's not really useful (in such a context) to use an image, with English text, to represent a Button; I'd really like to know how to produce an HTML Button with localized label and an invoked Struts action.
Programming Jakarta Struts Review,
October 10 2003
Submitted by Tingbin
[
Respond |
View]
Just an suggestion to those who have similar problem like me when using the the sample code.
If you run the smaple Storefront and you cannot get any item detail page. The problem is that in ItemDetail.jsp line # 69, there is a redundant paramId in that <html:link>. Simply delete that one, then you will go.
Tingbin
Programming Jakarta Struts Review,
October 09 2003
Submitted by Someone
[
Respond |
View]
"Buy a clue"? Is this from some quiz on television?
Yep, but I thought I should specify my opinion a little. When I wrote my review, I was disappointed: I've come to expect so much from O'Reillys books, that when I figured out that this book wasn't the reference I was hoping it was, it made me wrote as I did.
My opinion wasn't targeted at Chuck. He has used a lot of time to this book and deserves my full respect. He clearly knows Struts very well. I just hoped, that he would have gone little bit deeper than the basics. Maybe he was short on time?
Maybe the second edition(?) will be "The Struts Book" (as happened with
Java Performance Tuning, 2nd edition - truly great book). But currently I would give that crown to another title.
(I gave two points, so that I don't drag down the average)
Programming Jakarta Struts Review,
October 06 2003
Submitted by Brian DeRocher
[
Respond |
View]
David Trussel, Thomas H.,
I solved the
org.apache.jasper.JasperException:
Cannot find bean FeaturedItemsKey in any scope
problem. It appears we were all doing the same thing.
That is writing the code by hand to learn it better,
instead of just plugging and chugging.
The problem is we were never invoking com.oreilly.
struts.storefront.catalog.FeaturedPageAction as
prescribed in struts-config.xml. You see that's
where the bean gets registerd or whatever.
Why wan't it being invoked? Because...
<action path="/home" ....> wasn't being called.
We were calling http://..../storefront/index.jsp
directly. Instead we should call .../storefront
and let it load welcome.jsp, which redirects to
<logic:forward name="welcome" /> and again in
struts-config.xml we have
<forward name="welcome" path="/action/home" />
That's the problem there... that line is not in the
Complete struts-config.xml file on page 96.
So i suggest getting storefront.war from oreilly's
web site and looking at the struts-config.xml in
there.
Programming Jakarta Struts Review,
October 04 2003
Submitted by Chuck Cavaness
[
Respond |
View]
I agree - let's settle down a little here. I appreciate both the positive reviews and the constructive criticism. There's no need to attack anyone for his or her opinion. Thanks for passionate support of the book, but one size doesnt fit all and everyones has a different perspective.
So everyone, chill.
Programming Jakarta Struts Review,
October 01 2003
Submitted by John Robbins
[
Respond |
View]
Could Mike Rosenblath please refrain from using ad-hominem attacks and name calling? He's entitled to his opinions but calling others morons because they don't share his viewpoint seems rather immature.
Programming Jakarta Struts Review,
September 25 2003
Submitted by Mike Rosenblath
[
Respond |
View]
This is actually a post based on the review that I just read from "Cezar Grzelak
" on this site. I was actually going to give this book a rating of 4 because I thought the tags section could have included more examples. However, after reading the review from Mr. Cezar, Im going to change my rating to a 5. Obviously, Mr. Cavaness has to deal with morons like this and being a wannabe writer of books, Im sympathetic to Chucks cause.
Im not sure what book Cezar read, but it obviously wasnt this one. This is by far the best source of information on Struts available. Now, if you are looking for someone to hold your little hand through every nuance, then I suggest you pay for a training course. Otherwise, I seriously suggest you take another look through the book and this time, read the words.
I was also at the Utah Users Group meeting last week when Chuck did a presentation on Struts. Not only was it a very funny and entertaining look at Struts and the industry as a whole, he knows his stuff and can present it with ease.
Mike
Programming Jakarta Struts Review,
September 25 2003
Submitted by Cezar Grzelak
[
Respond |
View]
In a single word: awful. The book has a completely disjoint structure. There is no simple worked example of a working struts application. We are introduced to concepts that are not explained until late in the book. The author may know struts pretty well but he fares poorly as a mentor.
I almost think this one must have been one of those efforts to rush the title to the market just so that it hits the shelves right after struts 1.1 release.
This may be a fine book to refresh your memory if you already know struts. For someone who's trying to learn struts from scratch this book is a waste of a Safari slot.
Programming Jakarta Struts Review,
September 10 2003
Submitted by noone
[
Respond |
View]
someone, you're a moron. Buy a clue!
Programming Jakarta Struts Review,
September 09 2003
Submitted by Someone
[
Respond |
View]
I think this is the worst book about Struts that I have read so far. If you don't know the basics, then you
might use it, but for others it's a waste of money.
Programming Jakarta Struts Review,
August 25 2003
Submitted by dong
[
Respond |
View]
good
Programming Jakarta Struts Review,
August 21 2003
Submitted by Tingbin
[
Respond |
View]
I already donwlloaded all the file from your site. I changed the struts-config.xml file for my oracle database. I creted all tables in my dabatase. I build the application again, deploy to my Oc4J servler. I can see the frontpage, but when I clicked any part image, "page cannot found error" occured, for example if I click mufflers, the link goes to "http://localhost:8000/storefront/action/viewitemdetail?id=116" but no page can be found. I check DB tables they are all empty. How should run this example?
Thanks
Tingbin
Programming Jakarta Struts Review,
August 19 2003
Submitted by Chuck Cavaness
[
Respond |
View]
Try this URL for the neccessary files:
http://examples.oreilly.com/jakarta
Programming Jakarta Struts Review,
August 19 2003
Submitted by Tingbin
[
Respond |
View]
For example storefront, where can I find the tool or code in the book which I can use to populate the database tables? Without those data, the example cannot work.
Thanks
Tingbin
Programming Jakarta Struts Review,
August 19 2003
Submitted by Tingbin
[
Respond |
View]
Just a question. I deploy the storefront.war in my OC4J server. The first page shows fine. I click one image of those auto parts, it goes to this URI
http://localhost:8000/storefront/action/viewitemdetail?id=116
but cannot fine the page. Did you know why?
Thanks
Tingbin
Programming Jakarta Struts Review,
August 11 2003
Submitted by Geert
[
Respond |
View]
As a beginning struts/tomcat programmer I like the book very much. The storefront example is very usefull, the only problem I have with it is that sometimes I'm confused wether I have to put an example in the code or not. (eg, the multiple application modules in chapter 4.7.4)
Programming Jakarta Struts Review,
August 01 2003
Submitted by Chuck Cavaness
[
Respond |
View]
Conor,
I have to say that I'm completely puzzled by your post as I've received many good comments about its usefulness. However, I have learned (from writing several books) that everyone learns differently and what might be a good approach for one is completely wrong for someone else. So, I respect your opinion and apologize that it didnt meet your needs. I do plan to update the book and would appreciate any detailed feedback on what specifically you want from a book (e.g. more examples). Before I wrote this book, I spent a couple of months on the Struts list querying for what Struts users wanted from a book and tried to satisfy those cravings. I also published the chapters to everyone on theserverside.com and took feedback and added to the book. I dont think Ill do the same for the next edition, but if you have more detailed feedback and care enough to send it to me, please send it to chuckcavaness@yahoo.com. Ill make sure to hit those points.
Chuck
Programming Jakarta Struts Review,
August 01 2003
Submitted by Conor Maguire
[
Respond |
View]
Dear O'Reilly & Associates,
I have never been compelled to write such an email before but I have recently finished your "Programming Jakarta Struts" written by Chuck Cavaness and wish to provide you with some feedback on it.
Firstly, let me say that I am hugely disappointed with this book. I have long been a fan of your books, having read many Java and web development titles e.g. Enterprise JavaBeans by Monson-Haefel, anything by Brett McLaughlin, all of which were superb. In fact, I think I have about 15 O'Reilly titles in my technical library.
It therefore came as a great shock to come across a technical book which is completely lacking in useful examples, and indeed seems to be nothing more than a rewrite of the Struts documentation which is available freely with the Struts distribution itself. The Struts documentation is already famously sketchy.
The book introduces a "Storefront" example but fails to delve into the details of what would be a useful example application. There are practically NO examples of the Struts tags (granted, developers should probably be using JSTL anyway. But I digress.)
I believe that many chapters in this book are completely irrelevant to a developer wanting to build a Struts application. Chapter 13 which deals with EJB is a complete waste of book space. Ditto chapters 12, 15, 16 and 17. In all fairness, does an entire chapter on "logging" really belong in a book on this topic?
I have since read some reviews (Amazon etc.) of "Programming Jakarta Struts" thinking perhaps that I have missed the point of this book. But I have found that many people share my view.
I think the Struts framework is excellent, but I've found developing Struts applications using your book as a reference, to be a very frustrating experience. My opinion of O'Reilly books has not diminished but I will be exercising more caution in future.
Many thanks for your time and keep up the (otherwise) good work.
C Maguire
Programming Jakarta Struts Review,
July 31 2003
Submitted by ANIL MAHAJAN
[
Respond |
View]
GOOd
Programming Jakarta Struts Review,
July 21 2003
Submitted by Chuck Cavaness
[
Respond |
View]
Arin,
I sent you a response from the email you sent. Let me know if it helps.
Just so others who are reading this "hidden treasure trove of Struts doubloons (Sorry just saw Pirates of the Caribbean), let me share with you the response that I sent.
There are several places that this type of behavior can be added. It will most likely take an extension to the framework, but thats what extensions points are all about.
Here are some of the options:
1) Extend the ActionServlet and override the process() method.
2) Extend the RequestProcess and override one of the many public methods.
3) Use a ServletFilter and intercept the request (assuming a 2.3 container).
Programming Jakarta Struts Review,
July 21 2003
Submitted by Arin
[
Respond |
View]
Hi ...
Your book is awesome ... but I have one question that I didn't find an answer to in the book.
I need to be able to do click through analysis of the web application I'm working on (its Struts 1.1) and the Tomcat logs aren't enough. The Tomcat logs give you the URL of the action that the user requested, however this action could have any number of <forwards> ... so I really don't know what "happened" in the logs (I need to know what JSP was served up) ...
Is there any way to be able to get the servlet container to log all the standard stuff ( IP, session, timeStamp etc) but log the path info from the struts-config.xml's <action><forward path="theJSPToLog.jsp"></action>instead of logging the action's URL.
Or ... is there a quick mod to the struts source that can do this for me?
I appreciate the help.
Arin Sarkissian
Spoke Software
Programming Jakarta Struts Review,
July 21 2003
Submitted by Chuck Cavaness
[
Respond |
View]
Take a look at the error-page declarations within the web.xml. You may need to consult the Serlvet Specification or better yet, the O'Reilly Servlet/JSP book. Although Struts can use this, it has more to do with ordinary Servlet/JSP applications.
There's also support within the JSP page to declare some page to handle the errors. A JSP tutorial or book would be better at providing you with the details of this.
Programming Jakarta Struts Review,
July 21 2003
Submitted by bryan
[
Respond |
View]
Hi Chuck,
Regarding the exception/error handling, when using Struts, we can use <html:errors/>, or specify the input page in the struts-config.xml to display the error messages when something goes wrong with the Java classes( such as Action, business classes ), but do we need to handle the exception/error produced by the JSP file itself in Struts, if this is needed, how do we handle it?
Thank you very much.
Bryan.
Programming Jakarta Struts Review,
July 15 2003
Submitted by bryan
[
Respond |
View]
Overall this is an excellent book. Many helpful discussions on design which makes this book a great one.
Programming Jakarta Struts Review,
July 11 2003
Submitted by Chuck Cavaness
[
Respond |
View]
Thomas,
Email me at chuckcavaness@yahoo.com. I'll be more than happy to help you get up and running.
Programming Jakarta Struts Review,
July 11 2003
Submitted by Thomas H.
[
Respond |
View]
Just forgotten my E-Mail-Adress ...
Programming Jakarta Struts Review,
July 11 2003
Submitted by thomas h.
[
Respond |
View]
Hi Chuck,
i like your book, but i think there are a little too many repititions.
I have the same problem that a guy named David Trussel described on
February 11, 2003
When selecting the index.jsp in a browser, i got:
org.apache.jasper.JasperException: Cannot find bean FeaturedItemsKey in any scope
The problem seems to be a missing bean "FeaturedItemsKey" used inside the "include/featureditems.inc"
Unfortunately you didn't react on the question of David.
I hope, you can help me/us with that problem.
Thank you
Thomas
Programming Jakarta Struts Review,
July 10 2003
Submitted by Chuck Cavaness
[
Respond |
View]
I don't consider the class "com.oreilly.struts.storefront.service.StorefrontServiceFactory" to be part of the Model. It's a utility class used by the presentation layer (in this case, Struts) to locate and initialize whatever model layer the web application is using. Notice also that it imports "javax.servlet" classes, which also couples it to the presentation layer and specially the web channel. Maybe I should have packaged it in a location that made that more obvious, sorry.
Email me if that's not clear and we can discuss more.
Programming Jakarta Struts Review,
July 10 2003
Submitted by nocontrol
[
Respond |
View]
Question to Chapter 6 "Struts Model Components"
You write: The model should not know nor implementing anything from the
presentation tier.
That means to me: the model knows nothing about struts and the web-container.
But, later in this chapter (Building the Storefront Model) you're implementing the struts plugin interface in the StoreFrontFactory.
To reach the application scope?
So, you're model is tied to struts, isn't it ?
Programming Jakarta Struts Review,
June 18 2003
Submitted by Chuck Cavaness
[
Respond |
View]
Aaron,
Take a look through chapter 7 again, especially the lifecycle figure on pg 179 and the material on 184. To summarize, when an Action has finished doing its work, it forwards to a resource (in most cases its a JSP). The ActionForm that was passed in to the Action has been stored in the proper scope as setup in the <action> element (see lifecycle diagram on pg. 179). As long as you do a forward and not a redirect, all objects including the ActionForm instance will still be in the request scope when the JSP is rendered. As with any of object in request, session or application scope, the JSP can access this data. So whatever type of information that is available in the ActionForm, you can use the Struts tag libraries to access it and display it in the JSP.
Hope that helps,
chuck
Programming Jakarta Struts Review,
June 16 2003
Submitted by Aaron V. Humphrey
[
Respond |
View]
It seems that the "user reviews" section has turned into a "quiz the author" public forum. Maybe O'Reilly should do this for all its books!
In any event, I liked the book and found it mostly quite useful(at least the first eight chapters--I'll get to the rest when I have more time, but this was enough to get me off the ground). There is one issue which I think is very basic, though, which I couldn't find answered in the book.
I start with a form on the page login.jsp. I associate LoginForm with that form via the "/signin" action. The LoginAction class can successfully forward control to either success.jsp or failure.jsp.
But what I want is for the loginName property of LoginForm to be displayed on success.jsp. From what I gather, the html tag library can do this for form elements...but what if I just want to display it as a string?
Is the LoginForm bean automatically available to the action that I forward to, or do I have to attach it to the HttpServletResponse object somewhere? It might be useful to have this issue addressed more directly in the next edition of the book.
Programming Jakarta Struts Review,
June 09 2003
Submitted by Tin
[
Respond |
View]
This is the third book I read on Struts and I strong recommend it to others. Beginner or advanced. Programming Jakarta Struts is an O'Reilly quality book. Succinct, informative and provides excellent examples.
My only reason for not giving a full rating was that I felt the Internationalization section could have had more detail and examples of use.
This seems to be true for every other Struts books I have read of perused so far.
Programming Jakarta Struts was definitely worth my time and money.
Programming Jakarta Struts Review,
June 06 2003
Submitted by chuckcavaness
[
Respond |
View]
Bryan,
I don't understand exactly what you mean by "empty hidden form class". Are you saying that you have data that you need to store in a hidden field and pass on to the next page?
This may be easier to answer in a email thread. Why don't you reply to my email account at chuckcavaness@yahoo.com.
Programming Jakarta Struts Review,
June 06 2003
Submitted by bryan
[
Respond |
View]
Hi Chuck,
How are you.
In one of my jsp pages without form, I defined a "return" button which acts as a submit button(in my opinion), once this "return" button is pressed, the request will be send to another page, according to the suggestions made by Struts, all the requests should go through the ActionServlet, so I implemented this jsp file like the following:
------------------------
<html:form action="/someActionMapping">
<input type="hidden" name="" value="">
<html:submit property="submit<U></U>">
<bean:message key="label.button.return"/></html:submit>
</html:form>
--------------------------
But I need to define an empty Hidden Form class and also specify it in the corresponding action mapping in the configuration file, this way works, but I just want to find out is there other way to solve the problem?
Thanks a lot.
Bryan
Programming Jakarta Struts Review,
June 05 2003
Submitted by jin
[
Respond |
View]
rgfdg
Programming Jakarta Struts Review,
May 29 2003
Submitted by chuck cavaness
[
Respond |
View]
Bryan,
The good news is that Struts has no requirements or constraints other than those that standard web applications require and/or expect. That is, each node in the cluster would need to have a copy of the web application, all objects stored in the session would need to be serializable in order to facilitate failover and a good rule of thumb is to try and make as much as possible stateless. The less stateful objects you have, the easier it becomes to transfer session information. Other than these types of items, just build your Struts applications like you would any other web application where failover is a requirement.
In terms of load balancing, you can sometimes use the container as the load balancer (like WebLogic) or you can use a plugin for something like IIS. There are also commercial third-party products that provide more robust functionality. Most of the containers that provide a load balancer support things like "round robin", but some of the fancier products can use "least used" or other types of schemes.
Programming Jakarta Struts Review,
May 29 2003
Submitted by chuck cavaness
[
Respond |
View]
Arindam,
By default, the ActionMessages and ActionErrors are saved into the Request object and therefore go away after the response is rendered on the client. However, you can manually place these error messages into the session and then when neccessary, get them out and display them to the user. It'll take a little more work on your part because you'll have to remember to manually remove them after you display them to the user. However, this is pretty straightforward and is what most developers do to solve this problem.
Chuck
Programming Jakarta Struts Review,
May 28 2003
Submitted by bryan
[
Respond |
View]
Hi Chuck,
As you know, in some organizations, failover and load balancing is very important for the mission-critical web
applications, say, in order to support either failover or load balancing, we need to deploy our application on various
app servers, that means, if struts are used, we need the various Struts applications to run on them which is in clustered
environment, can Struts handle such an application when the failover or load balancing occurred? In simple words, how does
it handle?
Thanks for your reply.
Bryan.
Programming Jakarta Struts Review,
May 28 2003
Submitted by Arindam
[
Respond |
View]
Hi! Chuck,
It's a nice book for programming with struts. But even after going through your book (particularly page 169 to 207) I have one question. Can I keep track of global errors over mutiple pages or forms and through them to the user(browser) at the end?
Than'x'
Bye,
Programming Jakarta Struts Review,
May 25 2003
Submitted by bryan
[
Respond |
View]
Thanks a lot, Chuck.
Bryan
Programming Jakarta Struts Review,
May 24 2003
Submitted by Chuck Cavaness
[
Respond |
View]
Bryan,
Chances are you're not going to like my answer here. This is one of those topics that can cause countries to go to war over. I have a co-worker that is a PHD Human Factors guy. He's done a ton of research around the area of the back button and how this should or shouldn't be used in a web application. Before he explained his findings to me, I would have said that the back button should be removed, disabled, etc. However, his research indicates that users expect it to work like you would imagine and therefore, being good application developers, we have to deal with it.
There's a couple of things you can do. One, disable caching. This is important for many reasons, not to mention stale data or showing sensitive data. Imagine walking into a public library and seeing a browser left open and you sit down and hit the back button a few times and see the previous user's banking information; not good. So you really should consider disabling caching. There are several steps neccessary, struts-config setting and JSP pages settings possibly.
The next thing to consider is that when the back button is pressed, the previous action will be executed. So you have to make sure to deal with that and all of the ramifications.
Rather than rehash what many other Struts users have asked about and received suggestions on, I'll include this "long" link that will list many of those already discussed threads.
Make sure to paste all of it into the browser or it will not work correctly. Once pasted into the browser, there should be no spaces between the lines.
http://nagoya.apache.org/eyebrowse/SearchList?listId=&listName=struts-user@jakarta.apache.org&searchText=%22back+button%22&defaultField=subject&Search=Search
Programming Jakarta Struts Review,
May 23 2003
Submitted by bryan
[
Respond |
View]
Thanks Chuck.
Can I ask you another question?
What is the better way to implement the Back button which once the back button is pressed, the previous page with the form is displayed with previously-entered data from the user populated in Struts?
Thanks a lot.
Bryan.
Programming Jakarta Struts Review,
May 23 2003
Submitted by Chuck Cavaness
[
Respond |
View]
Bryan,
I've put my responses after each question.
Thanks a lot, chuck.
I have to bug you again. I have 2 questions:
Q1:
Can you talk about how does the Struts working with distributed enterprise application, for example, how/can struts handle the distributed application, how struts handle the request send between the distributed servers?
[Chuck's Response]
Let me answer the question using a concrete example. Lets take a J2EE for example. Struts works with J2EE by invoking business services on the J2EE server using RMI/IIOP. Generally speaking, theres a mapping of one Struts Action to one business service, although this doesnt always have to be the case. For example, the DispatchAction can be used to map a single Struts Action to multiple backend services.
What typical developers/applications do is to use a business delegate to keep the EJB interfaces out of the Action classes. In other words, the Struts Action isnt aware that its using EJB. As far as it knows its using some local interface, but under the covers its an EJB remote reference. This allows the ugliness of JNDI, Home interfaces and remote interfaces to be encapsulated and hidden from the Struts framework.
In a J2EE cluster, theres usually an admin server (or in some cases a web server is used) to receive the request and direct it to one of the managed nodes in the cluster. In Chapter 13 of my book, I cover in much more detail the intricacies of Struts working with J2EE and specifically EJB.
Q2:
Since the Struts is open source which means there are no strong technical support (not community support), for the enterprise want to use Struts, how can they make sure one something goes wrong, they have confidence to deal with it?
Besides people suggested, if Struts is used, there has to be some people really go through the sorce code of Struts and understand all the details, is there any other ways?
Thanks again.
Bryan.
[Chuck's Response]
Its not much different than other technologies like EJB. You have to make sure that you have some solid lead developers working and mentoring others. Many organizations also use consultants/contractors to help supplement the team until the team is up to speed.
Another way is to have someone come in and do training for you on Struts. For example, Im designing a 2 or 3-day course on Struts. Presentations/Discussions with labs that walk someone through installation all the way through the framework, Validator, Tiles, Performance testing etc. I think theres real value to be gained in something like this.
Other than these ideas, youre really left with ha