Hi
<html>
<head>
<title>login form without database</title>
</head>
<body>
<table border="1" width="50%" bgcolor="greenlight" cellspacing="0" callpadding="0">
<tr>
<td width="100%">
<form method="POST" action="savenametosession.jsp">
<h2 align="center"><font color="pink">Login form without Database</font></h2>
<table border="0" width="100%" cellspacing="0" callpadding="0">
<tr>
<td width="50%" align="right"><b><font color="pink">User Name:</b></font></td>
<td width="50%"><input type="text" name="username" size="20"/> </td>
</tr>
<tr>
<td width="50%" align="right"><b><font color="pink">Password:</b></font></td>
<td width="50%"><input type="password" name="password" size="20"></td>
</tr>
</table>
<p><center><input type="submit" value="Submit" name="submit">
<input type="reset" value="Reset" name="reset"></p></center>
</form>
</td>
</tr>
</table>
</body>
</html>
----------------------------------
<%@ page language="java" %>
<%
String username=request.getParameter("username");
String password=request.getParameter("password");
if(username==null) username="";
if(password==null) password="";
session.setAttribute("username",username);
session.setAttribute("password",password);
%>
<html>
<head>
<title>Name Saved</title>
</head>
<body>
<p><a href="SessionAction.jsp"><b>Next Page to view the session value</a></b><p>
</body>
-------------------------------
<%@ page language="java" %>
<%
String username=(String) session.getAttribute("username");
String password=(String) session.getAttribute("password");
if(username==null) username="";
if(password==null) password="";
%>
<html>
<head>
<title>Show Saved Name</title>
</head>
<body>
<p><font color="red">Welcome to: <%=username%> <%=password%></font></p>
</body>
------------------------------------
Read for more information.
http://www.roseindia.net/jsp/