This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I've a problem ...
I'm trying to implement execAndWait interceptor...just to give an impression to the user that some heavy task starts executing..as sooon as he.she logs in....but...after displaying the default wait page for a certain period of time, the web page informs that a NPE is thrown...
my struts.xml is:::-->
The Exception's stack trace is as follows:::
The Action Class is:::
The line 32 of my Action Class is trying to test whether the user has entered his/her name or not !!
Check to see if your field "username" is exactly the same as the one received from your form JSP . Check for spelling mistakes . Also verify that you are using the correct case . Keep care , since UserName is not the same as username .
Muhammad Saif Asif Mirza
OCJA(5/6) OCJP(6) OCJWCD(6)
Joined: Apr 11, 2012
Saif Asif wrote:Check to see if your field "username" is exactly the same as the one received from your form JSP . Check for spelling mistakes . Also verify that you are using the correct case . Keep care , since UserName is not the same as username .
Hi Asif...the field names in the jsp's properly correspond to the properties in the Action Class, as mentioned in the first post, the issue arises only when i put an execAndWait interceptor reference in struts.xml.......and the moment I remove the interceptor reference, everything goes fine, I think the inclusion of the execAndWait interceptor is "kind of" keeps on preventing the mapping of form fields to the respective properties in the Action Class.....but if that is the problem...How can I cure it ??
Why don't you have a "wait" result configured for your action?
I see the documentation says the following:
Important: Because the action will be running in a seperate thread, you can't use ActionContext because it is a ThreadLocal. This means if you need to access, for example, session data, you need to implement SessionAware rather than calling ActionContext.getSession().