This is the login application in which you will get the complete login facilities whatever should be in a web based application for protecting the page or the website accessibility. This application provides authentication for accessing application after successful login. For accessing the application everyone should have a user id and a password regarding of that.
This application is very useful for developing any type of web based application in which login application is needed. Here Roseindia provides you a complete login application in the JSF Tutorial section to teach you JSF by examples. You are here after getting all the theoretical concepts from the previous section of the Roseindia JSF Tutorial. If you have already completed all the theoretical concepts from the Roseindia JSF Tutorial then OK otherwise first you should complete previous sections from the Roseindia JSF Tutorial.
Here, you are going to study the JSF Login Application that is simply for the login purpose that illustrates you about the procedure of developing applications in JSF. You will know how JSF works after following the example.
This section here provides you a simple but the important thing for protecting your any type of web application that makes your website or application secure. This application is simply used for providing the facility for accessing the application by getting authentication.
When you run the application, this application will tell you for entering your login Id and Password. If you enter wrong login id or password it will show you for "Login failed!" and if you enter the correct login id and password then the application shows the message "Login Successful!". For logging the application first you have to know your login id and password which are given as follows:
Login ID: chandan
Password: chand
Now, you can enter in your application by using the login page.
For running your application you will have to copy the complete application folder in your tomcat/webapps directory after extracting the downloaded zip file. And type the url: http://localhost:8080/SimpleLogin/login.jsf in your browser.
Output of Simple Login Application:
If you enter wrong login id or password then the application shows the output like the following image:
And if you enter correct login id and password then the application shows the output like as follows:
There are some files have been used for constructing the application. These files have been explained as follows:
Here is the code for the login.jsp file:
<%@ page contentType="text/html"%> |
Here is the code for the resultforfail.jsp file:
Login Failed! |
Here is the code for the resultforsuccess.jsp file:
Login Successful! |
Here is the code for the Backing Bean SimpleLogin.java file:
package roseindia;
|
faces-config.xml file code:
|
web.xml file code:
version="1.0"?>
|
Download This Complete Application.
0 comments:
Post a Comment