I have a login page where if a user gets a password exception, I want to display a custom error from my resource bundle on my login.jsp page. Here is my code for the bean. How would I tell this to use the correct message in my resource bundle?
Code:try{ //String userid2 = "user1"; //String userid = userid; //System.out.println("what is user id: " + //System.out.println("Now going to connect to db using DAO"); //System.out.println("what is user id and password: " + getUserid() + " " + getPassword()); DAOFactory daoFactory = DAOFactory.getDAOFactory((short) 2); CustomerDAO custDAO= daoFactory.getCustomerDAO(); String rtns1 = custDAO.getPassword(getUserid()); //System.out.println("Password from the DB -> "+rtns1); //boolean passwordMatch = true; boolean passwordMatch= rtns1.equalsIgnoreCase(getPassword()); //System.out.println("What is the password please.... "+ passwordMatch); if (passwordMatch) { return "success"; } else { return "failure"; } } catch(PasswordNotFoundException ex){ ex.printStackTrace(); return "failure"; }


Reply With Quote
Bookmarks