QUESTION: Develop a web application using HTML &Servlets for the given scenario below: (Required database tables implementation must be done) Write a servlet that enables the user to change the password from an HTML form, as shown in Figure. Suppose that the user information is stored in a database table named Account with three columns: username, password, and name, where name is the real name of the user. The servlet performs the following tasks:
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
QUESTION:
Develop a web application using HTML &Servlets for the given scenario below: (Required database tables implementation must be done) Write a servlet that enables the user to change the password from an HTML form, as shown in Figure. Suppose that the user information is stored in a database table named Account with three columns: username, password, and name, where name is the real name of the user. The servlet performs the following tasks:
Verify that the username and old password are in the table. If not, report the error and redisplay the HTML form. Verify that the new password and the confirmed password are the same. If not, report this error and redisplay the HTML form. If the user information is entered correctly, update the password and report the status of the update to the user, as shown in Figure. AIM:
To develop a web application to change the password using database connectivity.
<Font color="red" style=background-color:"yellow">Lord Of The Rings</FONT></BODY><br></br>
<FONT color="blue">yahoo</FONT><br></br>
<FONT COLOR="purple"><B>
Back to Main Page</B></BODY></HTML>
OUTPUT:
RESULT:
Thus the given program to displays factorial value of all the prime numbers from 1 to 100 is done and output is verified successfully.
Ex.No:3.1(B)
Date:
QUESTION :
Design a web application using jsp that performs the following operation (you must have at least two web pages). Design an output jsp page that computes and displays the inverse of the integer given as input from first jsp page and also display the double (twice) of the reversed integer in output jsp page.
AIM :
To create a web application that computes and displays the inverse of the integer given as input from first jsp page and also display the double (twice) of the reversed integer in output jsp page.
<%@page session="true" %><% int n=Integer.parseInt(request.getParameter("i"));
int n1=n%10;
int n2=n/10;
out.println("reverse value:"+n1+""+n2);
int a=n1*10+n2;
out.println("double"+a*a); %>
OUTPUT:
RESULT :
Thus the given program to that computes and displays the inverse of the integer given as input from first jsp page and also display the double (twice) of the reversed integer in output jsp page is done and output is verified successfully.
QUESTION :
Develop a web application using jsp and session for the following scenario. (You must create at least 3 jsp pages and you should use session object to pass the values) Design a login page that gets the user name and password from the user. If the user name and password matches “AJP” and “123” respectively, it has to display the success message with user name in a different page. Else it has to redirect to the login page.
AIM :
Ex.No:3.1(C)
Date:
To design a login page that gets the user name and password from the user. If the user name and password matches “AJP” and “123” respectively, it has to display the success message with user name in a different page. Else it has to redirect to the login page.
Thus the given program to design a login page that gets the user name and password from the user. If the user name and password matches to display the success message with user name in a different page. Else it has to redirect to the login page is done and the output is verified successfully.
QUESTION :
Design a jsp page to display a form as shown in following figure. Validate all the user data by another jsp page.
AIM :
To design a jsp page and validate the following data.
PROGRAM :
OUTPUT:
RESULT:
Thus the given program to design a jsp page and validate the following data is done and output is verified successfully.
Ex.No:3.2(A)
Date:
QUESTION :
Create a JSP and JDBC-based address book. Your address book should allow one to insert entries, delete entries and search for entries. AIM:To Create a JSP and JDBC-based address book should allow one to insert entries, delete entries and search for entries. PROGRAM:<html><head><title>book</title></head><body>
RESULT:Thus the given program to Create a JSP and JDBC-based address book should allow one to insert entries, delete entries and search for entries is done and output is verified successfully.
QUESTION:
Create a Web application for retrieving employee details from database Design the following GUI using JSP and generate the required output by retrieving data from database.
AIM:To create the a Web application for retrieving employee details from database. PROGRAM:New.html:
<html> <head> <title>TODO supply a title</title> </head>
//st.execute(q); /* q = "insert into employe values('122','yogith','5000','5/5/2012')"; st.executeUpdate(q); q = "insert into employe values('123','arun','5000','2/3/2000')"; st.executeUpdate(q); q = "insert into employe values('124','scott','5000','3/4/2013')"; st.executeUpdate(q); q = "insert into employe values('125','john','5000','2/5/20115')";st.executeUpdate(q);*/ q="select * from employe where id='"+id+"' "; ResultSet rs=st.executeQuery(q); while (rs.next()) { out.println("id:"+rs.getString(1) +"<br> name:"+ rs.getString(2) +"<br>salary name:"+ rs.getString(3)+"<br>hired date:"+ rs.getString(4)); }} catch (SQLException e) {out.println(e); }%><%@ include file="newhtml.html"%> OUTPUT:
RESULT:Thus the given program to create the a Web application for retrieving employee details from database is done and output is verified successfully.
QUESTION :
(Assign grades) Write Bean class that accepts student scores, gets the best score, and then assigns grades based on the marks. Bean class can have methods to data, calculates result and prints it. Access the Bean class from JSP document. Design a HTML/JSP page to read user data.
AIM :
To create a Bean class that accepts student scores, gets the best score, and calculates result and prints it. PROGRAM :
Thus the given program to create a Bean class that accepts student scores, gets the best score, and calculates result is done and the output is verified successfully.
Ex.No:4.1(B)
Date:
QUESTION :
Write a bean class that returns student names in decreasing order of their scores. Access the Bean class from JSP document. Design a HTML/JSP page to prompts the user to enter the number of students, the students’ names, and their scores
AIM :
To create a Bean class that that returns student names in decreasing order of their scores. Access the Bean class from JSP document. PROGRAM :
Thus the given program To create a Bean class that that returns student names in decreasing order of their scores is done and output is verified successfully.
QUESTION :
Create a bean class that checks whether two words are anagrams. Two words are anagrams if they contain the same letters in any order.. Bean class can have methods to accept data, calculates result and prints it. Access the Bean class from servlet document. Design a HTML/JSP page to read user data.
AIM :
Create a bean class that checks whether two words are anagrams.