From reader Gary and reader Marcus Caton:
Hello world application contains error. focus="username" should be focus="person" otherwise there are javascript errors and no focus.
Listing 3.1 - hello.jsp
html:form tag focus="username" attribute should be focus="person".
From reader Dan Allen:
Shouldn't you mention that the perform() method in the Action has been deprecated and is now the execute() method (if you are going to keep up to date with Struts 1.1).
Also, the ActionForward has been deprecated for ForwardConfig, which now has the ability to perform a redirect outside of the current application, contrary to the discussion at the end of Chapter 8. Doing the response.redirect() is now an unnecessary interjection.
I really question the need for the query string on the form definition.
form action="/HelloWorld.do?action=gotName"
When you request hello.jsp, the HelloAction class never get's instantiated, so it will have the same affect.
It also seems that the message resources file on the cd is named ApplicationResources.properties even though the struts-config.xml points to a Application.properties under ch03/hello
Good catches, Dan. As you might imagine, it was a real struggle to keep up with everything changing as 1.1 prepared to go out the door. We are trying to catch anything we missed here.
We're also trying to improve the chapter 3 stuff, as I mentioned elsewhere, Kevin's done a new version of the zip file.
- James
I followed the instructions for installing the EJB application, and all required software, in Chapter 18. When I try to bring up the URL, I get the following error:
javax.servlet.ServletException:
Error communicating with JBoss:
struts.ch18.client.CustomerUpdateException:
java.rmi.MarshalException: error marshalling
arguments; nested exception is:
java.net.SocketException: Connection
aborted by peer: socket write error
Any ideas on what I should check to fix this?
Thanks,
Tony
I'm unable to use torque in Stoctracker sample application. The book didn't give a hint how to install it.
Posted by: Ville on May 15, 2003 10:26 AMI believe I have found another issue in the chapter 3 code.
In hello.jsp the HelloModel is referenced by the hardcoded attribute name "ch03.hello". However, the attribute is named using the constant where it is created (HelloAction).
Shoudn't hello.jsp refer to the model via name='<%= ch03.hello.Constants.HELLO_KEY %>' ?
Posted by: Paul McCulloch on June 13, 2003 06:43 AMmore posts to this thread would be helpful, right?
Posted by: zip codes on June 30, 2003 04:54 PMtest
Posted by: Texas Refinance on July 22, 2003 09:37 PMI Installed Tomcat and MySQL from the CD and ran init_db.sql & populate_database.sql. I installed the stocktrack.war from Chapter 17. After restarting Tomcat I ran the stocktrack application. I was unable to successfully add a new user and address. The validation worked beautifully - even picking up errors in the bank routing number. But when all validation errors were corrected, the submit resulted in a blank page (/stocktrack/newUserAddress.do). Login with a random name and password also results in blank page (stocktrack/login.do). Same results with JDK 1.4 or 1.3.
Any hints would be appreciated,thanks,
Bruce.
Bruce,
I have exactly the same problem (with the chapter 11 war file). Running on JBoss 3.2.1 I get a blank page and this exception: org.apache.torque.TorqueException: Torque.getPool(): pools is null, did you call Torque.init() first?
Ok, not as important a code errors, but I found a typo...
Listing 3.4 pg. 40
Second paragraph last line of comment:
"will not be nedded after the View is generated"
nedded = needed
Just started reading the book and wasn't sure where to post this besides here.
Posted by: John on August 19, 2003 03:39 PMI didn't find any error.
Posted by: activex download on September 15, 2003 05:46 PMMishka rules !
Posted by: Mishka on September 23, 2003 10:45 AMMishka rules !
Posted by: Mishka on September 23, 2003 11:49 AMNice catch, Dan Allen. You aren't the Dan Allen that works in Reston, VA, at CI, are you?
Posted by: Book Review on October 1, 2003 02:22 PMYou did not provide an example of the web.xml file for the Hello World example in the book. Not explaining what needs to go into the web.xml file and why is very confusing.
I had to unpack the pre-packaged code and compare everything until I found what I did wrong.
Posted by: Mike on October 2, 2003 11:11 AM