<link rel="stylesheet" type="text/css" href="css/default.css">
</head>
<%
- userbean usr = (userbean) session.getAttribute("user");
+ UserBean usr = (UserBean) session.getAttribute("user");
String login_path = request.getContextPath() + "/index.jsp";
if (usr == null) {
session.invalidate();
<link rel="stylesheet" type="text/css" href="<%=css_path %>" />
<script src="<%=script_path%>" type="text/javascript"></script>
</head>
-<%
- userbean usr = (userbean) session.getAttribute("user");
- //if( (session.getAttribute("user_id") == null) | (session.getAttribute("user_id") == "" ) ){
- if (usr == null) {
- session.invalidate(); //request.getContextPath()+"/Index.jsp"
- // response.sendRedirect(login_path);
- response.sendRedirect(response.encodeRedirectURL(login_path));
- } else {
- /* String user_id = (String) session.getAttribute("user_id");
- String user_name = (String) session.getAttribute("user_name");
- //String user_pass = (String) session.getAttribute("user_pass");
- String role_id = (String) session.getAttribute("role_id");
- String role_name = (String) session.getAttribute("role_desc");
- String last_login = (String) session.getAttribute("last_login");
- // userbean usr = (userbean) session.getAttribute("user");
- //out.println("object value: "+usr.getName());
- */
+<%\r
+ UserBean usr = (UserBean) session.getAttribute("user");\r
+ //if( (session.getAttribute("user_id") == null) | (session.getAttribute("user_id") == "" ) ){\r
+ if (usr == null) {\r
+ session.invalidate(); //request.getContextPath()+"/Index.jsp"\r
+ // response.sendRedirect(login_path);\r
+ response.sendRedirect(response.encodeRedirectURL(login_path));\r
+ } else {\r
+ /* String user_id = (String) session.getAttribute("user_id");\r
+ String user_name = (String) session.getAttribute("user_name");\r
+ //String user_pass = (String) session.getAttribute("user_pass");\r
+ String role_id = (String) session.getAttribute("role_id");\r
+ String role_name = (String) session.getAttribute("role_desc");\r
+ String last_login = (String) session.getAttribute("last_login");\r
+ // userbean usr = (userbean) session.getAttribute("user");\r
+ //out.println("object value: "+usr.getName());\r
+ */\r
%>
<body>
<span class="preload1"></span>
--- /dev/null
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package org.mcb.services;
+
+/**
+ *
+ * @author yawar.saeed
+ */
+public class UserBean {
+ private String userid;
+ private String password;
+ private String RoleDesc;
+ private String LastLogin;
+ private String Name;
+ private String Branch;
+ private String RoleId;
+ private boolean valid;
+
+ public String getName() {
+ return Name;
+ }
+
+ public void setName(String newName) {
+ Name = newName;
+ }
+
+ public String getBranch() {
+ return Branch;
+ }
+
+ public void setBranch(String newBranch) {
+ Branch = newBranch;
+ }
+
+ public String getRole() {
+ return RoleId;
+ }
+
+ public void setRole(String newRole) {
+ RoleId = newRole;
+ }
+
+ public String getRoleDesc() {
+ return RoleDesc;
+ }
+
+ public void setRoleDesc(String newRoleDesc) {
+ RoleDesc = newRoleDesc;
+ }
+
+ public String getLastLogin() {
+ return LastLogin;
+ }
+
+ public void setLastLogin(String newLastLogin) {
+ LastLogin = newLastLogin;
+ }
+
+ public String getPassword() {
+ return password;
+ }
+
+ public void setPassword(String newPassword) {
+ password = newPassword;
+ }
+
+ public String getUserId() {
+ return userid;
+ }
+
+ public void setUserId(String newUserId) {
+ userid = newUserId;
+ }
+
+ public boolean isValid() {
+ return valid;
+ }
+
+ public void setValid(boolean newValid) {
+ valid = newValid;
+ }
+}
*/
protected void processRequest(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
- userbean user = new userbean();
+ UserBean user = new UserBean();
user.setUserId(request.getParameter("txt_userid"));
user.setPassword(request.getParameter("txt_pass"));
user = udac.login(user);
this.passwordservice = passwordservice;
}
- public userbean login(userbean user) {
+ public UserBean login(UserBean user) {
// preparing some objects for connection
Connection currentCon = null;
ResultSet rs = null;
+++ /dev/null
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-
-package org.mcb.services;
-
-/**
- *
- * @author yawar.saeed
- */
-public class userbean {
- private String userid;
- private String password;
- private String RoleDesc;
- private String LastLogin;
- private String Name;
- private String Branch;
- private String RoleId;
- public boolean valid;
-
- public String getName() {
- return Name;
- }
-
- public void setName(String newName) {
- Name = newName;
- }
-
- public String getBranch() {
- return Branch;
- }
-
- public void setBranch(String newBranch) {
- Branch = newBranch;
- }
-
- public String getRole() {
- return RoleId;
- }
-
- public void setRole(String newRole) {
- RoleId = newRole;
- }
-
- public String getRoleDesc() {
- return RoleDesc;
- }
-
- public void setRoleDesc(String newRoleDesc) {
- RoleDesc = newRoleDesc;
- }
-
- public String getLastLogin() {
- return LastLogin;
- }
-
- public void setLastLogin(String newLastLogin) {
- LastLogin = newLastLogin;
- }
-
- public String getPassword() {
- return password;
- }
-
- public void setPassword(String newPassword) {
- password = newPassword;
- }
-
- public String getUserId() {
- return userid;
- }
-
- public void setUserId(String newUserId) {
- userid = newUserId;
- }
-
- public boolean isValid() {
- return valid;
- }
-
- public void setValid(boolean newValid) {
- valid = newValid;
- }
-}