my dog learned polymorphism
The moose likes Struts and the fly likes java struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "java struts" Watch "java struts" New topic

java struts

sibasish padhi

Joined: Apr 11, 2005
Posts: 12
I want to populate an error message while a login is invalid .Can anyone please tell me the steps which I have to follow. I am using Struts . so plz reply me back soon.
alan do
Ranch Hand

Joined: Apr 14, 2005
Posts: 354
there are 2 ways:
1. add a ActionMessage() to your Globals.MESSAGE_KEY (where ActionMessages are stored (if you don't know how to do this, you need to look it up)

2. throw an exception that is of type/extends java.lang.Exception upon failed validation and map the exception to an action/jsp that states login failed (ideally, it should return the user to the same login form). again, you need to know how to configure struts to handle exception thrown.

-/a<br />certified slacker...yes, my last name is 'do' - <a href="" target="_blank" rel="nofollow"></a>
I agree. Here's the link:
subject: java struts
It's not a secret anymore!