code for jsp login page if user forgot password reminding password with hint question.the table login is created in database
February 6, 2010 at 3:18 PM
Hi Friend,
Try the following code:
1)email.jsp:
<html>
<form method="post" action="recoverpass.jsp">
Enter Email Id:<input type="text" name="emailid"><input type="submit" value="Submit">
</form>
</html>
2)recoverpass.jsp:
<%@page import="java.sql.*"%>
<%
String pass="";
String email=request.getParameter("emailid");
try{
Class.forName("com.mysql.jdbc.Driver").newInstance();
Connection con = DriverManager.getConnection("jdbc:
mysql://localhost:3306/test","root";, "root");
Statement st=con.createStatement();
ResultSet rs=st.executeQuery("select password from login where email='"+email+"'");
if(rs.next()){
pass=rs.getString("password");
}
else{
out.println("Invalid");
}
System.out.println(pass);
rs.close();
st.close();
con.close();
}
catch(Exception e){}
%>
<form method="post" action="mail.jsp">
Enter Alternate Email Id:<input type="text" name="altEmail">
<input type="hidden" name="id" value="<%=email%>">
<input type="hidden" name="pass" value="<%=pass%>">
<input type="submit" value="Submit">
</form>
3)mail.jsp:
<%
String email=request.getParameter("id");
String emailto=request.getParameter("altEmail");
String pass=request.getParameter("pass");
%>
<html>
<body>
<table border="1" width="50%" cellpadding="0" cellspacing="0">
<tr><td width="100%">
<form method="POST" action="mail.jsp">
<table border="1" width="100%" cellpadding="0" cellspacing="0">
<h1>Mail API</h1>
<tr><td width="50%"><b>To:</b></td><td width="50%"><input type="text" value="<%=emailto%>" name="to" size="30"></td></tr>
<tr><td width="50%"><b>From:</b></td><td width="50%"><input type="text" name="from" size="30"></td> </tr>
<tr><td width="50%"><b>Subject:</b></td><td width="50%"><input type="text" name="subject" size="30"></td></tr>
<tr><td width="50%"><b>Description:</b></td><td width="50%"><textarea name="description" type="text"
cols="40" rows="15" size=100>Your Password is: <%=pass%>.
Email id= <%=email%>
Password= <%=pass%>
</textarea>
</td></tr>
<tr><td><p><input type="submit" value="Send Mail" name="sendMail"></td></tr>
</table>
</form>
</td></tr>
</table>
</body>
</html>
And the following link will help you to send this mail.
http://www.roseindia.net/mail/sending-an-email-in-jsp.shtmlhttp://www.roseindia.net/javamail/Thanks
Related Tutorials/Questions & Answers:
java server pages - Java Server Faces Questionsjava server pages code for jsp login page if user forgot password reminding password with hint question.the table login is created in database Hi Friend,
Try the following code:
1)email.jsp:
Enter Email
Introduction to the JSP Java Server Pages source code.
Introduction to JSP
Java Server Pages or JSP... applications.
JSP
Tutorials - Introducing
Java Server Pages... Fundamentals
JSP termed as
Java Server Pages is a technology
introduced
Advertisements
Java Server Pages(JSP)Java Server Pages(JSP)
... and
platform-independent. The JavaServer
Pages specification extends the
Java
Servlet API... dynamic web content on the
server using HTML, and XML templates, and
Java
code
JSP - Java Server PagesJSP
JSP stands for
Java Server Pages. JSP is
Java technologies for creating
dynamic web applications. JSP allows the developer to embed
Java code inside
HTML. It makes the development of dynamic web application very easy in
Java Tutorials - Java Server Pages Technology
Tutorials -
Java Server Pages Technology
... held. This makes
server-side
Java a very exciting area.
JavaServer
Pages.... The JavaServer
Pages
specification extends the
Java Servlet API
linking of pages in java a register page how can i do this
in
java (applet ie frames)i made to
pages one for login and other for register pls rply
Java linking two
pages...linking of
pages in java i made a login form
accountno:
password
java pages runjava pages run how do we run jsp file in the browser. do we need to install
server. could it be run on the xamp
server
You need Apache Tomcat
Server to run the jsp code over it. Follow these steps to run the simple
EasyEclipse Server Java EasyEclipse
Server Java
EasyEclipse
Server Java
For development of
server-side
Java applications, such
as JavaServer
Pages, EJBs and Web Services.
EasyEclipse
Java Server Pages (JSP)Java Server Pages (JSP)
In this tutorial we are going to give you over view... before it's processed by the
server.
It is built on top of
Java Servlets API... the JSP
pages, web
server requires a JSP engine. The JSP container
Tomcat Web Server Tomcat Web
Server
Introduction to the
Tomcat web
server
Tomcat is an open source web
server developed by Apache
Group. Apache Tomcat is the servlet
jsp pagesjsp pages I am using 3 jsp
pages in an application..
1.login.jsp
2.checkuser.jsp:is connected to databse..from this page im giving path to search.jsp
3.search.jsp:Here we need fetch data from data base..do u want to connect
Introduction to the Tomcat web server
Reference Implementation for the
Java Servlet and JavaServer
Pages technologies.
The
Java Servlet and JavaServer
Pages specifications are developed by Sun under...
Introduction to the Tomcat web
server
HTML pages.HTML
pages.
Description :
HTML is a hypertext markup language. Every HTML page has two part one head
part another is body. It will run on browser.
Anything available in head will not display on browser. Body part is used
Ajax Pages
Ajax
Pages
Ajax
Pages is a scripting template engine that enables rapid development of
Ajax Web-based Applications, just like GMail, Google Maps, A9 and Backpack, but
without having
Introduction to Tomcat Server Servlet and JavaServer
Pages technologies. The
Java Servlet and JavaServer
Pages...Introduction to Tomcat
Server
... is an open source web
server developed by Apache Group. Apache Tomcat is the servlet
JavaServer Pages (JSP) RoseindiaJavaServer
Pages (JSP) is used to develop dynamic web content on the
server
using HTML, XML templates, and
Java code. JSP is extensively used because...
pages
that get compiled into
Java servlets the first time they are invoked.
JSP
Iterating through pages with a sample
java/ jsp code or technical details of how to iterate through the
pages...". And the next 100 records will get displayed in the page2. The
pages go on wrt
ModuleNotFoundError: No module named 'pages'ModuleNotFoundError: No module named '
pages' Hi,
My Python program is throwing following error:
ModuleNotFoundError: No module named '
pages'
How to remove the ModuleNotFoundError: No module named '
pages'
Web Server pages to the client. Apache and Microsoft's Internet
Information
Server (IIS) are two leading web servers. In the case of
java
language, a web
server is used...
Web
Server
A web
jquery search for html pagesjquery search for html pages i want to search html
pages with jquery, it is k for single page but i want search more than one page at a time.
Thank you in advance
server side scripting java - JSP-Servletserver side scripting java I Very new to
java server pages I am doing a project in
java messaging service so in that i have a client on d
server... on the
server side i want that in the client side as pop up window
Description of GlassFish Application Server
Description of GlassFish Application
Server
GlassFish is a free, open source application
server that
implements the newest features in the
Java EE 5 platform. The
Java EE 5 platform
includes
ModuleNotFoundError: No module named 'creh-pages'ModuleNotFoundError: No module named 'creh-
pages' Hi,
My Python... 'creh-
pages'
How to remove the ModuleNotFoundError: No module named 'creh-
pages' error?
Thanks
Hi,
In your python environment you
ModuleNotFoundError: No module named 'tear-pages'ModuleNotFoundError: No module named 'tear-
pages' Hi,
My Python... 'tear-
pages'
How to remove the ModuleNotFoundError: No module named 'tear-
pages' error?
Thanks
Hi,
In your python environment you