java server pages

java server pages

code for jsp login page if user forgot password reminding password with hint question.the table login is created in database
View Answers

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.shtml
http://www.roseindia.net/javamail/

Thanks










Related Tutorials/Questions & Answers:
java server pages - Java Server Faces Questions
java 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 Pages
JSP 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
ModuleNotFoundError: No module named 'SPYCE---Python-Server-Pages'
ModuleNotFoundError: No module named 'SPYCE---Python-Server-Pages'  ...: No module named 'SPYCE---Python-Server-Pages' How to remove the ModuleNotFoundError: No module named 'SPYCE---Python-Server-Pages' error? Thanks
ModuleNotFoundError: No module named 'SPYCE---Python-Server-Pages'
ModuleNotFoundError: No module named 'SPYCE---Python-Server-Pages'  ...: No module named 'SPYCE---Python-Server-Pages' How to remove the ModuleNotFoundError: No module named 'SPYCE---Python-Server-Pages' error? Thanks
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 run
java 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
java code for registration and login pages, mysql as a bankend.
java code for registration and login pages, mysql as a bankend.  please send me the java code for registration and login pages and to store the data in mysql
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
why jsp pages are not working on linux but java application is working in windows - JSP-Servlet
why jsp pages are not working on linux but java application is working in windows  java web application jsp pages are not showing the fileds corectly on linux server but same application is working on windows.why
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 pages
jsp 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
php create pages automatically
php create pages automatically  How to create pages automatically in PHP
JavaServer Pages (JSP) Roseindia
JavaServer 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
Maven dependency for com.jivesoftware - jive-selenium-pages-framework version 1.0.12-RC02 is released. Learn to use jive-selenium-pages-framework version 1.0.12-RC02 in Maven based Java projects
of jive-selenium-pages-framework released The developers of   com.jivesoftware - jive-selenium-pages-framework project have released the latest version... - jive-selenium-pages-framework library is 1.0.12-RC02. Developer can use
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
dynamic web pages in html
dynamic web pages in html  How to create Dynamic web pages in HTML
static page and dynamic pages?
static page and dynamic pages?  what is the static page and dynamic pages
static page and dynamic pages?
static page and dynamic pages?  what is the diff between static page and dynamic pages
static page and dynamic pages?
static page and dynamic pages?  what is the static page and dynamic pages adv and disadv
how to save web pages in a partcular document in html format using java.. - Java Beginners
how to save web pages in a partcular document in html format using java..  i have to save a particular web page in a folder in html format using java. the url will be the input of the program. the program when run will first
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'
validating web pages
validating web pages  How to validate HTML web 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
tabs or indents in Web pages
tabs or indents in Web pages  How do you create tabs or indents in Web pages
jquery search for html pages
jquery 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-Servlet
server 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
JSP pages are provided in Struts framework?
JSP pages are provided in Struts framework?  What helpers in the form of JSP pages are provided in Struts framework
JSP pages are provided in Struts framework
JSP pages are provided in Struts framework  What helpers in the form of JSP pages are provided in Struts framework
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 'djaodjin-pages'
ModuleNotFoundError: No module named 'djaodjin-pages'  Hi, My... named 'djaodjin-pages' How to remove the ModuleNotFoundError: No module named 'djaodjin-pages' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'ebird-pages'
ModuleNotFoundError: No module named 'ebird-pages'  Hi, My Python... 'ebird-pages' How to remove the ModuleNotFoundError: No module named 'ebird-pages' error? Thanks   Hi, In your python environment
ModuleNotFoundError: No module named 'extract-pages'
ModuleNotFoundError: No module named 'extract-pages'  Hi, My... 'extract-pages' How to remove the ModuleNotFoundError: No module named 'extract-pages' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'lemon-pages'
ModuleNotFoundError: No module named 'lemon-pages'  Hi, My Python... 'lemon-pages' How to remove the ModuleNotFoundError: No module named 'lemon-pages' error? Thanks   Hi, In your python environment
ModuleNotFoundError: No module named 'pinax-pages'
ModuleNotFoundError: No module named 'pinax-pages'  Hi, My Python... 'pinax-pages' How to remove the ModuleNotFoundError: No module named 'pinax-pages' error? Thanks   Hi, In your python environment
ModuleNotFoundError: No module named 'pretalx-pages'
ModuleNotFoundError: No module named 'pretalx-pages'  Hi, My... 'pretalx-pages' How to remove the ModuleNotFoundError: No module named 'pretalx-pages' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'pretix-pages'
ModuleNotFoundError: No module named 'pretix-pages'  Hi, My Python... 'pretix-pages' How to remove the ModuleNotFoundError: No module named 'pretix-pages' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'pyramid_pages'
ModuleNotFoundError: No module named 'pyramid_pages'  Hi, My... 'pyramid_pages' How to remove the ModuleNotFoundError: No module named 'pyramid_pages' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'react-pages'
ModuleNotFoundError: No module named 'react-pages'  Hi, My Python... 'react-pages' How to remove the ModuleNotFoundError: No module named 'react-pages' error? Thanks   Hi, In your python environment
ModuleNotFoundError: No module named 'samklang-pages'
ModuleNotFoundError: No module named 'samklang-pages'  Hi, My... named 'samklang-pages' How to remove the ModuleNotFoundError: No module named 'samklang-pages' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'selenium-pages'
ModuleNotFoundError: No module named 'selenium-pages'  Hi, My... named 'selenium-pages' How to remove the ModuleNotFoundError: No module named 'selenium-pages' error? Thanks   Hi, In your python
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

Ads