Get the tools you need to learn Java skills fast!
Video tutorials, eBooks, hands-on lab exercises, sample code.
Get started
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 Badass: Making Users Awesome this week in the Game Development 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?
I agree. Here's the link:
subject: validation in the form bean