Hi
<html>
<head>
<title>Insert into database</title>
</head>
<body>
<table border="1" width="50%" bgcolor="pink">
<tr>
<td width="100%">
<form method="POST" action="loginAction.jsp">
<h2 align="center">login page</h2>
<table border="1" width="100%">
<tr>
<td width="50%"><b>User Name:</b></td>
<td width="50%"><input type="text" name="userid" size="20"/> </td>
</tr>
<tr>
<td width="50%"><b>Password:</b></td>
<td width="50%"><input type="password" name="password" size="20"/> </td>
</tr>
</table>
<p><input type="submit" value="Submit" name="submit">
<input type="reset" value="Reset" name="reset"></p>
</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/