Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JavaMail Role based login ..Need the concepts..

Have Programming Question? Ask it here!
 
 
 


Anandh
Role based login ..Need the concepts..
2 Answer(s)      6 years and a month ago
Posted in : JavaMail



Advertisement
View Answers

August 26, 2008 at 6:09 PM


Hi friend,


This code help to solve your problem :

Some points remember
"login.jsp"

1)Code have two file "login.jsp" and "welcome.jsp".
2)In "login.jsp" if select "Admin" it display "Delete" button with success message" and if select "Employee" it not display "Delete".


<html>
<head>
</head>
<body>
<form name="loginform" method="post" action="welcome.jsp">
<table>
<tr>

<tr>
<td>Login Name</td>
<td>
<select name="type">
<option value="Admin">Admin</option>
<option value="Employee">Employee</option>
</select>
</td>
</tr>
<tr>
<td>Login Name</td>
<td><input type="text" name="userName" value=""></td>
</tr>
<tr>
<td>Password</td>
<td><input type="password" name="password" value=""></td>
</tr>

<tr>
<td></td>
<td><input type="submit" name="Submit" value="Submit"></td>
</tr>
</table>
</form>


</body>
</html>

"welcome.jsp"

<html>
<head>
</head>
<body>
<table>

<%

if((request.getParameter("type")!=null) && request.getParameter("userName")!="" && (request.getParameter("userName")!=null) && (request.getParameter("password")!=null))
{
if(request.getParameter("type").equals("Admin") )
{
%>
<tr>
<td><b>Welcome <%=request.getParameter("userName")%></b></td></tr>
<tr><td><input type="button" value="Delete"></td></tr>

<%
}
if(request.getParameter("type").equals("Employee"))
{
%>
<tr>
<td><b>Welcome <%=request.getParameter("userName")%></b></td></tr>
<%
}

}
else
{
response.sendRedirect("login.jsp");
}
%>
</body>
</html>

If you have any more problem then give in details.

Read for more information :

http://www.roseindia.net/

Thanks





September 3, 2008 at 4:00 PM


Thank You .. i too have done the same way only... but the Login Type as Hidden value and i am checking tht and then redirecting them ... fine..

With Regards,
K.M.Anandh


Related Tutorials/Questions & Answers:
Role based login ..Need the concepts.. - JavaMail
Role based login ..Need the concepts..  Role based login how can i do... or usergroup... but depending upon the role the functions should change... requriement.... Hoping for different concepts ... :-) With Regards, K.M.Anandh
User LogIn According to Role
User LogIn According to Role  User login According to role but output will be always displayed in a single page.. but content will change according role
Advertisements
Spring alternative to Form Based Login
Spring alternative to Form Based Login  print("code sample");how can we make a server to listen to login event i.e. Authenticate a user not using jsp. Using a login form we can use the jspringsecurity_check. How can we do
need a login applet in java
need a login applet in java  i'm java beginner. Can some java master teach me how to write a login applet? combine with my coding import javax.swing.*; import java.applet.*; import java.awt.*; import java.util.*; import
need a login applet in java
need a login applet in java  i'm java beginner. Can some java master teach me how to write a login applet? combine with my coding import javax.swing.*; import java.applet.*; import java.awt.*; import java.util.*; import
need code for login in asp.net with c#
need code for login in asp.net with c#  hai iam trying to develop a project in asp.net with c#,so i need a code for login page using which admin and other users can log in.plz help me, thanks in advance
Need to get the Data based on Date
Need to get the Data based on Date  Hie , I am having a criteria where i need to get the data based on date . I have written the query as "from Balance as b where b.date like ?" But the date field in DB is in datetime2 format
PHP Based Chatserver - Design concepts & design patterns
PHP Based Chatserver  Hey i want to create a Chat server like this one : www.scn-chat.com could someone plz tell me were can i get a chatserver
Need query for rollup based on month and category
Need query for rollup based on month and category   Hi, Here is my question.. I have a table as below. trans_date,cateory,amount 1-1-11,1,10 2-1-11,2,20 3-2-11,3,15 23-2-11,4,12 13-5-11,4,19 Need a query to get result like
Need help to create Struts 2 MySQL based HRMS application.
Need help to create Struts 2 MySQL based HRMS application.   Hi Sir, I am doing my project based on Human Resource Management system using struts 2... login and profile management. Please reply me asap. Thanks in advance.   
Need to implement Paging and field based sorting in JSP Servlet - JSP-Servlet
Need to implement Paging and field based sorting in JSP Servlet  Hi, Can some one please guide me how we can implement the paging and field based... Roll No. Class etc etc As per my requirement i need to first
Need J2ee project technical flow - Design concepts & design patterns
Need J2ee project technical flow   Hi friend,am newbie to web development.I need j2ee project technical project flow. For example Browser ---> Controller --> Servlet(validator) <
Role of Project Manager
Role of Project Manager  What are the role of a project manager in an Organisation
design role played by Struts.
design role played by Struts.  What is the design role played by Struts
login
login  login page display an error showing failure to login even when the correct information is entered
role of JSP in MVC
role of JSP in MVC  What is the role of JSP in MVC Model?   JSP is mostly used to develop the user interface, It plays are role of View in the MVC Model
login
login  how to login admin and user with the same fields(name & password) in single login page while the table for admin and user is seprate in database(mysql) please provide me solution
login
login  i want to now how i can write code for form login incolude user and password in Jcreator 4.50   Hello Friend, Visit Here Thanks
login
java.awt.event.*; class Login { JButton SUBMIT; JLabel label1,label2; final JTextField text1,text2; Login() { final JFrame f=new JFrame("Login Form...(); ResultSet rs=st.executeQuery("select * from login where username='"+value1
login
login  how to create login page in jsp   Here is a jsp code that creates the login page and check whether the user is valid or not. 1...;tr><td></td><td><input type="submit" value="Login">
login
login  i am doing the project by using netbeens.. it is easy to use the java swing for design i can drag and drop the buttons and labels etc.. now i want the code for login.. i created design it contains the field of user name
login
login  i am doing the project by using netbeens.. it is easy to use the java swing for design i can drag and drop the buttons and labels etc.. now i want the code for login.. i created design it contains the field of user name
login
login  i am doing the project by using netbeens.. it is easy to use the java swing for design i can drag and drop the buttons and labels etc.. now i want the code for login.. i created design it contains the field of user name
login
login  i am doing the project by using netbeens.. it is easy to use the java swing for design i can drag and drop the buttons and labels etc.. now i want the code for login.. i created design it contains the field of user name
login
login  hello i need some help please help how can identify admin from user when logging in? please make some answer and some explanation...   Please visit the following link; http://www.roseindia.net/jsp
need
need  i need a jsp coding based project plz help me
After Clicking Image I need Popup Window - Design concepts & design patterns
After Clicking Image I need Popup Window  Hi Friends. when i click any image button , i need to display popup window in javascript.can u give code for this New Document EMPLOYEE DETAILS
DIFFERENT PAGES FOR DIFFERENT USERS ACCORDING TO THEIR ROLE
DIFFERENT PAGES FOR DIFFERENT USERS ACCORDING TO THEIR ROLE  I HAVE A PROBLEM IN PHP CODING PLS HELP ME PROBLEM IS THAT I WANT DIFFERENT PAGES TO VIEW FOR DIFFERENT USERS WHEN THEY LOGIN ACCORDING TO THEIR ROLE IN DATABASE
Struts 2 Login Application
Struts 2 Login Application       Developing Struts 2 Login Application In this section we are going to develop login application based on Struts 2 Framework. Our current login application
Configure resource and security-role references
Configure resource and security-role references Prev Chapter 6. Assemble enterprise applications...; Configure resource and security-role references
Login Application
Login Application       This tutorial provides some simple steps for creating a website login application that can be used later in any big Struts Hibernate and Spring based
Role of Project Manager
A software project manager plays a key role for the development of any software project in an organisation. The role and responsibilities of a project... as business knowledge. The major role and responsibilities of a project manager
Hibernate concepts
Hibernate concepts  hibernate concepts Entity System,Entity Named Resolver,Auxiliary database objects,ternary associations and interceptors are used in real -time programming
Need of Marketing Segmentation
plays a vital role in successfully running for any company. The all exercise... the company in identifying the customers need and demands with the products... important as it plays major role for its marketing. After identifying
Top 10 Web Developments Concepts Designers Should Know
Top 10 Web Developments Concepts Designers Should Know When it comes to web... concepts is so challenging. For some years with the proliferation of mobile computing... increasingly, web development and design concepts also went through a great array
login page
login page  code for login page
login-logout
login-logout  how to do login and logout using session in php
login page
login page  How to login as different user in php
Login page
Login page  how to create Login page in java
LOGIN ERROR
LOGIN ERROR  ERROR SCRIPT: LOGIN FAILED", $_SESSION['login fail']='0',}?> Ty Team
OOPs concepts in Java
Object-Oriented Programming (OOPs) concepts in Java helps in creating programs that are based on real world. OOPs is very flexible and compatible and hence... application that are developed on the OOPs concepts at first analyze the program
login authentication - Java Beginners
login authentication  i 've designed the jsp page for login. now i need to connect it with the bean and do authentication for the login for the "register" table in mysql. can anybody help me with the code immediately
Login authentication
Login authentication  i want d code for login authentication from mysql database on the same pc using swings
Login authentication
Login authentication  i want d code for login authentication from mysql database on the same pc using swings
Login Page
Login Page  Can anyone tell me the steps to create a login page in myeclipse 7.0 and validating it with login database in db2 9.7 ??? Please tell me
LOGIN PAGE
LOGIN PAGE  A java program with "login" as title,menus added, and a text field asking for firstname, lastname, and displaying current date and time
login application
login application  how to create login application ?   Hi, Please check the following tutorials: Video tutorial - JSP Login Logout Example Login Authentication using Bean and Servlet In JSP simple code to login user
login in jsp
login in jsp  i need code for login which is verify the registeration... and otherwise show the failed message.   JSP Login Form 1)login.jsp: <html>...(); ResultSet rs=st.executeQuery("select * from login where username='"+user
java based question
java based question  if there is a site and after user login on the right top there is a button of logout and i want to display firstname and lastname of the user after login then in what class i have to do changes?? and what
Login Program
Login Program  Login program in struts to set username & password in session. and this session is available in all screens for authentication..., Please read it at: Login/Logout With Session Accessing Session Object Thanks
Advertisements
 

 

 

DMCA.com