@@ -0,0 +1,1411 @@
+package com.pavi.javaheart.action;%0A%0Aimport java.util.Map;%0A%0Aimport org.apache.struts2.interceptor.SessionAware;%0A%0Aimport com.opensymphony.xwork2.ActionSupport;%0Aimport com.pavi.javaheart.bean.User;%0A%0Apublic class LoginAction extends ActionSupport implements SessionAware %7B%0A%0A%09private String userName;%0A%09private String password;%0A%0A%09public String getUserName() %7B%0A%09%09return userName;%0A%09%7D%0A%0A%09public void setUserName(String userName) %7B%0A%09%09this.userName = userName;%0A%09%7D%0A%0A%09public String getPassword() %7B%0A%09%09return password;%0A%09%7D%0A%0A%09public void setPassword(String password) %7B%0A%09%09this.password = password;%0A%09%7D%0A%0A%09private Map%3CString, Object%3E session;%0A%0A%09@Override%0A%09public void setSession(Map%3CString, Object%3E session) %7B%0A%09%09this.session=session;%0A%09%7D%0A%0A%09private boolean isValideUser(User user) %7B%0A%0A%09%09if (user.getUserName().equals(%22pravin%22)%0A%09%09%09%09&& user.getPassword().equals(%22kumbhar%22)) %7B%0A%0A%09%09%09return true;%0A%09%09%7D%0A%0A%09%09else %7B%0A%0A%09%09%09return false;%0A%0A%09%09%7D%0A%09%7D%0A%09%0A%09public String execute()%0A%09%7B%0A%09%09%0A%09%09clearFieldErrors();%0A%09%09%0A%09%09User user=(User) session.get(%22user%22);%0A%09%09%0A%09%09System.out.println(%22user%22+user);%0A%09%09if(user!=null)%0A%09%09%7B%0A%09%09return SUCCESS;%0A%09%09%7D%0A%09%09else%0A%09%09   %7B%0A%09%09%09User u =new User(userName, password);%0A%09%09%09System.out.println(%22isValideUser%22+isValideUser(u));%0A%09%09%09if(isValideUser(u))%0A%09%09%09%7B%0A%09%09%09%09session.put(%22user%22, u);%0A%09%09%09%09return SUCCESS;%0A%09%09%09%09%0A%09%09%09%7D%0A%09%09%09else %7B%0A%09%09%09%09%0A%09%09%09%09addFieldError(%22invalid%22, %22 Invalid User Name or Password %22);%0A%09%09%09%09return INPUT;%0A%09%09%09%7D%0A%09%09%09%0A%09%09%09%0A%09%09   %7D%0A%09%09%0A%09%09%0A%09%7D%0A%0A%7D%0A

Create LoginAction.java