• Post Reply Bookmark Topic Watch Topic
  • New Topic

java struts

 
sibasish padhi
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
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
Posts: 354
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!