aspose file tools*
The moose likes Struts and the fly likes ActionError  Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "ActionError  Problem" Watch "ActionError  Problem" New topic
Author

ActionError Problem

Swathi Prakash
Ranch Hand

Joined: Jan 18, 2005
Posts: 49
Hello,

i want to display error when user type invalid user name and password,i want to display that user name is invalid. i want to write the ActionError in Action class.
i write the below coding. it doesnt work.pls help me


rs=stmt.executeQuery("select * from login where name=\""+name1+"\" and pwd=\""+password1+"\"");
if(rs.next())
{
target="success";
HttpSession sess=request.getSession();
}
else{

target="login";
ActionErrors errors = new ActionErrors();
errors.add(ActionErrors.GLOBAL_ERROR,new ActionError("errors.login.required"));
saveErrors(request, errors);
}


i Included that in Propert file also .
please help me to find the solution.

Thanks in Advance


Swathi
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

Do you have <html:errors/> on your jsp to display errors?


A good workman is known by his tools.
Swathi Prakash
Ranch Hand

Joined: Jan 18, 2005
Posts: 49
ya,i included the tag<html:errors/> also. but i didnt get
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

Are you 100% positive that the else block is entered?
Swathi Prakash
Ranch Hand

Joined: Jan 18, 2005
Posts: 49
yes.it is entering into the else block and the target also going to that page which i specified.Also i check with my property file also.

the errors r not diplayed in my tasrget page. what is the problem?plz help me....

Swathi Prakash
Ranch Hand

Joined: Jan 18, 2005
Posts: 49
yes . i made a mistake in my proprty file.i got it.

thank you mr.Marc Peabody

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ActionError Problem