Home Answers Viewqa JSF-Questions java server pages

 
 


ramya
java server pages
1 Answer(s)      3 years and 4 months ago
Posted in : Java Server Faces Questions

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 Pages:
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
Java Server Pages(JSP)
Java Server Pages(JSP)     ...-independent. The JavaServer Pages specification extends the Java Servlet API to provide... content on the server using HTML, and XML templates, and Java code, which
Introduction to the JSP Java Server Pages
. Introduction to JSP Java Server Pages or JSP for short is Sun's...; JSP Tutorials - Introducing Java Server Pages Technology... JSP termed as Java Server Pages is a technology introduced by Sun
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
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   ... server-side Java a very exciting area. JavaServer Pages - An Overview.... The JavaServer Pages specification extends the Java Servlet API
Java Server Pages (JSP)
Java Server Pages (JSP) In this tutorial we are going to give you over view of JSP. What is JSP ? JSP is java based technology by using that you can... processed by the server. It is built on top of Java Servlets API, so as servlets
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
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
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
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
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
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
Introduction to Tomcat Server
and JavaServer Pages technologies. The Java Servlet and JavaServer Pages specifications...Introduction to Tomcat Server      ... server developed by Apache Group. Apache Tomcat is the servlet container
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   
Web Server
e-mail and building and publishing web pages. A web server works on a client... program. While talking about Java language then a web server is a server... pages and files), SMTP server (to support mail services), FTP server ( for files
Why application server is important?
Why application server is important?  Hi, I have to select the good application server for running my Java based web applications. Which application server or tomcat container is good to run the application. On my website
tomcat web server
Reference Implementation for the Java Servlet and JavaServer Pages technologies. ...Tomcat Web Server         ... the Tomcat Server Tomcat is an open source web server developed by Apache
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
jsf - Java Server Faces Questions
server javax.faces.CONFIG_FILES /WEB-INF/faces... /pages/login.jsp #{SimpleLogin.CheckValidUser} success /pages/resultforsuccess.jsp #{SimpleLogin.CheckValidUser} fail
Insert pages pdf
Insert pages pdf       In this program we are going to insert a new blank pages in pdf  file  through java program...;blank Pages"));     document.newPage();   
using session variable determine the no of pages viewd by the user
using session variable determine the no of pages viewd by the user  using session variable determine the no of pages viewd by the user   Hi.../java/jsp/trackuserSession.html Thanks
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
quickly - Java Server Faces Questions
; } } faces-config.xml: PersonBean PersonBean request /pages/admin.jsp addusers /pages/addusers.jsp addfieldusers /pages/addfieldusers.jsp sayHello /pages/Hello.jsp If i click the submitt button
JSF - Java Server Faces Questions
JSF  How to declare session variable and how it will access in other pages plz tell me the code  Hi Friend, To create session and it access on the other pages Follow some Steps : 1.Create a form in JSF
jsf - Java Server Faces Questions
jsf  Hi, In my project there are 3 jsp pages and one jsf page ,first jsp page forwarding the request to jsf page then this jsf gives the greeting page means if it is success it goes to success page otherwise it goes to failed
Difference between Web Server and Application Server
application server runs servlets and JSPs that are used to create HTML pages dynamically. For example, J2EE application server can run EJBs (Enterprise Java Beans... than Web server. Web server is used to create HTML pages only while
fill out forms on web pages - JDBC
fill out forms on web pages    I want to fill out forms on web pages, it's is very important to my project. For example there is a web-site... fields automatically by providing values in my java program. Please
jsf navigation rule - Java Server Faces Questions
, faces-config.xml: StoreNameBean PersonBean request /pages/admin.jsp addusers /pages/addusers.jsp addfieldusers /pages/addfieldusers.jsp /pages/addusers.jsp sayHello /pages/Hello.jsp /pages
What is JSP?
The JSP  Java Server Pages Technology: Java Server Pages is a technology from Sun that enables the Java programmers to generate HTML, XML or other... the programmers to embed Java code into html (.jsp) page. Java Server Pages are first
jsf command link - Java Server Faces Questions
: /pages... /pages/addusers.jsp addfieldusers /pages/addfieldusers.jsp   Hi
JSP Error Pages
JSP Error Pages      ... a server's default exception page. Even though most of the  well-designed pages generally shows the stack trace as well as the exception name and makes your
jsf navigation rule - Java Server Faces Questions
config.xml is /pages/admin.jsp addusers /pages/addusers.jsp addfieldusers /pages/addfieldusers.jsp if i fiil... /pages
trafic site statistics - Java Server Faces Questions
trafic site statistics  Hello, Does the framework JSF work for creating web pages containing 3D entities (like 3DCharts)and displaying web trafic... correspond the balises d:chartItem to a java class (Bean)? Thanks for any
JSF binding attribute - Java Server Faces Questions
/pages/login.jsp... /pages/resultforsuccess.jsp... /pages/resultforfail.jsp For read more
Read page from Web server
Java NotesRead page from Web server The Java io package provides classes and interface for accessing the web pages. You can even access the website... disk in a file. So, with the hop of java program you can download the HTML pages
very urgent - Java Server Faces Questions
; } } faces-config.xml: PersonBean PersonBean request /pages/admin.jsp addusers /pages/addusers.jsp addfieldusers /pages/addfieldusers.jsp sayHello /pages/Hello.jsp If i click the submitt button
jsf form output - Java Server Faces Questions
; } } faces-config.xml: PersonBean PersonBean request /pages/admin.jsp addusers /pages/addusers.jsp addfieldusers /pages/addfieldusers.jsp sayHello /pages/Hello.jsp If i click the submitt
jsf form output - Java Server Faces Questions
: PersonBean PersonBean request /pages/admin.jsp addusers /pages/addusers.jsp addfieldusers /pages/addfieldusers.jsp sayHello /pages/Hello.jsp
jsf jars - Java Server Faces Questions
jsf jars  Hi frnds, i done jsf simple pages those are working fine but byusing tag iam getting this exception: org.apache.jasper.JasperException: Cannot find FacesContext. Please tell me the list of jsfjars. Thanks in advance
online voting systems with 10 forms and 3 pages calculations
online voting systems with 10 forms and 3 pages calculations  kindly send me the online voting system and online inventory management systems used by java or html, with 10 forms and 3 validation pages, with form designing
Java server Faces Books
Java server Faces Books         Java server Faces...; Core Java server Faces
proxy server in java
proxy server in java  how to developed proxy server in java .. detail of what is proxy server
Application Server and Web Server - WebSevices
Pages), servlets, ASPs (Active Server Pages), server-side JavaScripts, or some... that are used to create HTML pages dynamically. In this case, J2EE application server can...Application Server and Web Server  General difference, Application
Tomcat an Introduction
; Apache Tomcat:  Apache Tomcat server is one of the most popular open source web server that implements the Java Servlet and the JavaServer Pages (JSP) specifications from Sun Microsystem to provide the platform to run Java code on a web
Java Server - Java Server Faces Questions
Java Server login Session  I have site in which user logs in and uses the services... the session should be closed so i used the java script, In java script i used... the toolbar in the java script through window.open
FTP server
FTP server  How to store a series of files in a ftp server using java
java with brava server integaration
java with brava server integaration  how to integrate java with brava java client
java with brava server integaration
java with brava server integaration  how to integrate java with brava java client

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.