0
我的行動後:我怎樣才能讓「先嚐試登錄時強制更改密碼」登錄
public class LoginAction extends org.apache.struts.action.Action {
/**
* This is the action called from the Struts framework.
* @param mapping The ActionMapping used to select this instance.
* @param form The optional ActionForm bean for this request.
* @param request The HTTP Request we are processing.
* @param response The HTTP Response we are processing.
* @throws java.lang.Exception
* @return
*/
@Override
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
LoginForm loginForm = (LoginForm) form;
HttpSession session = request.getSession(true);
String userName = loginForm.getUsername();
System.out.print("name::" + userName);
List list=new ArrayList();
String passWord = loginForm.getPassword();
System.out.print("here is Actionform::" + loginForm.toString());
list = StudentloginDAO.studentLogin(userName, passWord);
if (list.size() > 0) {
int id = (Integer) list.get(0);
System.out.println("id is" + id);
System.out.println(" List :: " + list.size());
System.out.println(" List :: " + list);
List<StudentSessionObjectStore> list1 = StudentSessionObject.studentSessionObject(id);
System.out.println("new list" + list1.size());
System.out.println("new list value" + list1);
session.setAttribute("getsessionObject", list1);
System.out.println("the Action attribute" + session.getAttribute("getsessionObject"));
return mapping.findForward(Constants.ACTION_FORWARD_SUCCESS);
} else {
request.setAttribute("LoginResult", Constants.ACTION_FORWARD_FAILURE);
return mapping.findForward(Constants.ACTION_FORWARD_FAILURE);
}
}
}
我的問題是我想去changePassword.jsp爲強制更改密碼當用戶第一次登錄。
有人可以幫我嗎?