Core Java| JSP| Servlets| XML| EJB| JEE5| Web Services| J2ME| Glossary| Questions?

 

 

 

 

 

 

 

 

 

 

 

 

 

Search Tutorials

Latest Questions
Comments
 
Login form 
 

Now for your confidence with JSP syntax, following example of login form will really help to understand jsp page.

 

Login Form with jsp

                         

Now for your confidence with  JSP syntax, following example of login form will really help to understand jsp page. In this  example we will create a simple dynamic JSP page that prints the user information into next page.

With the help of this example we are going to show- how to display a logged-in information on to the browser. 

In this example it is very easy to display it on our browser with the help of java.util package. In this example we are going to insert the data in the login form which will be displayed onto the next page. 

This jsp program works with html tags in which there are two fields one is for name and the other one is for entering  password and there is a submit button, that works on clicking. 

The code the program is given below:

<html>
<head>
<title>Enter your name and password</title>
</head>
<body bgcolor="#999966">
<p>&nbsp;</p>
<form method="POST" action="loginaction.jsp">
<p><font color="#800000" size="5">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Enter your name:</font><input type="text" name="username" size="20"></p>
<p><font color="#800000" size="5">
Enter your password:</font><input type="text" name="password" size="20"></p>
<p><input type="submit" value="Submit" name="B1"></p>
</form>
</body>
</html>

Here is the code of "loginaction.jsp" file:

<%@page contentType="text/html" %>
<html>
<body bgcolor="#999966">
<p><font size="6">Welcome :&nbsp; 
<%=request.getParameter("username")%></font></p>
</body>
</html>

The output of the program is given below:

This is the output of the above input:

Download Source Code

                         

» View all related tutorials
Related Tags: c database security web com rest ant website data io connection user password word uri name using this tab check

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Training Courses
Tell A Friend
Your Friend Name
Software Solutions
Least Viewed
Most Rated
Recently Viewed
Search Tutorials

 

 
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Indian Software Development Company | iPhone Development Company in India | Flex Development Company in India | Java Training Delhi | Java Training at Noida |

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.