This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Struts and the fly likes validation in the form bean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "validation in the form bean" Watch "validation in the form bean" New topic

validation in the form bean

farhath farook
Ranch Hand

Joined: Aug 01, 2007
Posts: 37
i did the form validation in the form bean as follows

ActionErrors errors = new ActionErrors();
if (getId() == null || getId().length() < 1) {
ActionMessage error = new ActionMessage("error.login");
errors.add("login", error);


And also added the error message in the property file as well.

the same code for validation in the action class gave me the error message in the JSP, but it is not giving the error message in for the validation in the form bean
can anyone help me . because am new to struts

thanks in advance
David Newton

Joined: Sep 29, 2008
Posts: 12617

I'm not sure what you mean: if the errors are showing up in the JSP what's the problem?
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: validation in the form bean
It's not a secret anymore!