R
Russ Perry Jr
Got another odd thing going on with our struts application...
Validation seems to be a little screwy. Right now I'm working
with our login.jsp, which is pretty basic.
We have a LoginActionForm that extends ValidatorForm. We
have our messages in ApplicationResources.properties and our
form/field info in validation.xml. But, for some reason
<html:errors /> is not outputting anything. However, where
I've put <logic:messagesPresent ...>, the messages DO show up
properly.
Initially, we had validate() commented out since reading that
ValidatorForm provides that (and reset()), but I put it back
with this format:
public ActionErrors validate(ActionMapping actionMapping,
HttpServletRequest httpServletRequest)
{
ActionErrors errors = super.validate(actionMapping,
httpServletRequest);
if (errors == null)
{
errors = new ActionErrors();
}
return errors;
}
....based on some sample code I found. Neither way makes a difference.
A little debugging shows that it is definitely going in here, and
moreso, errors != null so the super.validate() method appears to be
working fine (as the logic:messagesPresent tag would seem to verify).
Does html:errors NOT work with ValidatorForm, or is there maybe
something else I should be checking?
The other odd thing is that if I include <html:javascript
formName="LoginActionForm">, the script is included, and we get the
popup (windows.alert()) box, but it's blank! I don't know if that's
a clue, or something else, but figured I'd mention it.
Anyway, again, if anyone can offer some suggestions, I'd sure
appreciate it!
Validation seems to be a little screwy. Right now I'm working
with our login.jsp, which is pretty basic.
We have a LoginActionForm that extends ValidatorForm. We
have our messages in ApplicationResources.properties and our
form/field info in validation.xml. But, for some reason
<html:errors /> is not outputting anything. However, where
I've put <logic:messagesPresent ...>, the messages DO show up
properly.
Initially, we had validate() commented out since reading that
ValidatorForm provides that (and reset()), but I put it back
with this format:
public ActionErrors validate(ActionMapping actionMapping,
HttpServletRequest httpServletRequest)
{
ActionErrors errors = super.validate(actionMapping,
httpServletRequest);
if (errors == null)
{
errors = new ActionErrors();
}
return errors;
}
....based on some sample code I found. Neither way makes a difference.
A little debugging shows that it is definitely going in here, and
moreso, errors != null so the super.validate() method appears to be
working fine (as the logic:messagesPresent tag would seem to verify).
Does html:errors NOT work with ValidatorForm, or is there maybe
something else I should be checking?
The other odd thing is that if I include <html:javascript
formName="LoginActionForm">, the script is included, and we get the
popup (windows.alert()) box, but it's blank! I don't know if that's
a clue, or something else, but figured I'd mention it.
Anyway, again, if anyone can offer some suggestions, I'd sure
appreciate it!