Creating Login Page In JSF using NetBeans

This example illustrates you how to create a login form in JSF using NetBeans. To create the jsp page in NetBeans:

1. Right click on Web Pages under your project.
2. Go to New- JSP and click.
3. Enter JSP File Name (login, for this example) when New JSP File window appear.
4. Click Finish. Then the page will be created and listed as below:

Write your code for login. In this example, login.jsp is created. The code is given below:

Source Code of login.jsp

<%--
Document : login
Created on : Sep 10, 2008, 1:45:52 PM
Author : sandeep kumar suman
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
"http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>



Login Page















Description of all tags which is used in this program:

tag is used to create top level view and is a container for all JSF component tags on a page.
tag creates html form.
tag creates html table with specified number of columns.
tag is used for creating component for displaying formatted output as text.
tag is used to creates text input control (single line).

Run the program just by right click on login.jsp page and select run. The following output will be displayed on browser:


Download Source Code

0 comments:

Post a Comment