struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark <mar...@iinet.net.au>
Subject Re: NullPointerException with Validation Messages
Date Tue, 09 Sep 2008 23:51:34 GMT
Yes, all my actions are extending  
com.opensymphony.xwork2.ActionSupport.  Check the Jira for the full  
source to LoginAction.java.

No, I'm not using an <s:action...> tag.  Should I be?

Mark

On 10/09/2008, at 9:45 AM, Dave Newton wrote:

> You're extending ActionSupport, right?
>
> I'm also wondering if there's anything else on the value stack. Are  
> you using an <s:action...> tag?
>
> Dave
>
>
> --- On Tue, 9/9/08, Mark <markjb@iinet.net.au> wrote:
>
>> From: Mark <markjb@iinet.net.au>
>> Subject: Re: NullPointerException with Validation Messages
>> To: "Struts Users Mailing List" <user@struts.apache.org>
>> Date: Tuesday, September 9, 2008, 7:32 PM
>> I changed <div id="login"> to <div
>> id="loginContainer">, refreshed,
>> and I still get the NPE :-(
>>
>> If this help, I've also run into another problem which
>> is related.
>> If I implement the Validatable interface in my action, and
>> then add a
>> Field error (ie. addFieldError("userName",
>> "requiredString");) in the
>> validate method, the message displayed is incomplete.  It
>> will
>> display "is required" instead of "User Name
>> is required".  Note that
>> requiredString has ${getText(fieldName)} - the getText
>> isn't
>> returning the text.  When I look in the logs, there is a
>> warning
>> message (not a NPE) stating that I'm looking for a
>> message key that
>> is null.  I don't have the code currently setup to
>> reproduce this
>> problem, but I can if you'd like to see the exact
>> warning message.  I
>> think they are related because they both are producing a
>> null message
>> key.  Let me know what you think.
>>
>> Thanks,
>> Mark
>>
>>
>> On 10/09/2008, at 9:17 AM, Dave Newton wrote:
>>
>>> Here's something to try, although I still
>> can't get the NPE, which
>>> is irritating and scary:
>>>
>>> Your <s:form>'s action is "login",
>> which means the DOM's <form ...>
>>> id will also be "login". Because the markup
>> is arguably somewhat
>>> brittle, your <div id="login"> element
>> is colliding with the <form>.
>>>
>>> Try changing the <div> id to something like
>> "loginContainer" or
>>> whatever and see what that does.
>>>
>>> Dave
>>>
>>> --- On Tue, 9/9/08, Dave Newton wrote:
>>>> --- On Tue, 9/9/08, Mark wrote:
>>>>> Thank you for the suggestion.  Yes, I have and
>> it
>>>>> still produces the NullPointerException.
>>>>
>>>> You may want to try putting the complete webapp up
>>>> somewhere, or post a minimal, but complete, source
>> example
>>>> on something like pastebin/etc. I tried several
>> different
>>>> things to try to get the NPE but couldn't.
>>>
>>>
>>>
>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail:
>> user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail:
>> user-help@struts.apache.org
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail:
>> user-help@struts.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message