Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 2

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<jsp:useBean id="student" scope="request" class="CA5.Student" />
<jsp:setProperty name="student" property="*" />
<jsp:forward page="Display.jsp" />
</body>
</html>
Display.jsp
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body bgcolor=pink>
<jsp:useBean id="student" scope="request" class="CA5.Student" />
<h2>Entered Student Information</h2>
<br>
<br>
<h3>
Student Name :<jsp:getProperty name="student" property="sname" /><br>
USN :<jsp:getProperty name="student" property="usn" /><br>
Total Marks :<jsp:getProperty name="student" property="smarks" />
</h3>
</body>
</html>
Student.java
package CA5;
public class Student implements java.io.Serializable
{
public String sname;
public String usn;
public int smarks;
public Student() {
}
public void setsname(String e) {
sname = e;
}
public String getsname() {
return sname;
}
public void setusn(String en) {
usn = en;
}
public String getusn() {
return usn;
}
public void setsmarks(int m) {
smarks = m;
}
public int getsmarks() {
return smarks;
}
}

You might also like