Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JSF-Questions java server pages

Have Programming Question? Ask it here!
 
 
 


ramya
java server pages
1 Answer(s)      4 years and 7 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

Advertisement
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... JSP termed as Java Server Pages is a technology introduced by Sun
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   ... server-side Java a very exciting area. JavaServer Pages - An Overview.... 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 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
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 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
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
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
proxy server in java
proxy server in java  how to developed proxy server in java .. detail of what is proxy server
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   
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
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
java server - Development process
java server  Develop multi-threaded echo server and a corresponding GUI client in java
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
Java Connect to and FTP Server
Java Connect to and FTP Server  What is the code for Java Connect to and FTP Server? How to establish a connection to FTP server in Java? Thansk... the apache commons library to connect/login to FTP server. Link of complete example
Client Server Java app
Client Server Java app  I developed a client server based java... computer whereas the server program is on server computer. This works in my... heroku techniques for java but its hard for me to understand
chat server in java - RMI
chat server in java  how develope a chat server in java language,not standalone application,i want to develpoe a web base application,please give me a idea,code, this application deployed in a netwok  Hi Friend
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
server with two port - Java Server Faces Questions
server with two port  Hello, want to write two port server socket program using Java, (i.e. single server program which is listening on two ports... respectively. If C1 send object to the server (using the connection to 3122 port
java server on linux ystems
java server on linux ystems  hi.. i use linux... i want to remotely login into another linux system using java and then execute commands over that system.....how can i do this using java..password of host is known to us
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
JAVA SERVER PAGE
JAVA SERVER PAGE  hi, i want to know what is the need of JSP......and i want to get clear about all tech related to java instead of webapplications(Dynamic web project). because ajax,jsp,servelet..many tech like this i heard
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
chat server in java - JavaMail
chat server in java  sir i was ask u question related to the chat server,and you has given a answer,but sir i want to make a network based chat server ,in network base chat server ,there is no use of the AWT,SWING,in server side
Java - Java Server Faces Questions
Java  I want complete details about Java Server Faces.  Hi friend, Java Server Faces is also called JSF. JavaServer Faces is a new framework for building Web applications using JSP and Servlet. Java Server
tomcat server - Java Server Faces Questions
server error */ Jul 28, 2008 10:42:07 PM...) at org.apache.coyote.tomcat5.CoyoteConnector.initialize(CoyoteConnector. java:1326...) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:39
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
Weblogic server - Java Beginners
Weblogic server  how can we create connection poolong in weblogic 9.1 application server
Java to SQL Server Connectivity
Java to SQL Server Connectivity  Hi, heres my code private void bookedButton() { try { Class.forName... with sql server connectivity at the background to save the data. Now, after
apache tomcat server - Java Server Faces Questions
procedure.  Hi Friend, To install the tomcat server,please visit the following link: http://www.roseindia.net/web-application-server/tomcat/install
java - Java Server Faces Questions
java  Java Server Faces Quedtions  Hi friend, http://www.roseindia.net/interviewquestions/jsf/ http://www.roseindia.net/interviewquestions/jsf/JSF-interview-questions.shtml Thanks
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
mysql server connectivity - Java Server Faces Questions
mysql server connectivity  hello friends, my question is that i m not able to connect jsp, servlet with sql 2000. i know we have to do some changes in administrative tools in control pannel but after click
WAS server configuration from JAVA program
WAS server configuration from JAVA program  How to get web sphere server status like heap,connection pool properties,stall counts etc. from a java applciation
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
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
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
php create pages automatically
php create pages automatically  How to create pages automatically in PHP
proxy server and client using java - Java Beginners
proxy server and client using java  how to write program in java for proxy server and client
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
java - Java Server Faces Questions
Java reverse string recursively  Hi all, Please give me an example of java reverse string recursively
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
Advertisements
 

 

 

DMCA.com