Class 2 Intermediate Java 30-IT-397  

JavaBeans and JSPs

<%@page contentType="text/html"%>
<html>
<head><title>JSP Page</title></head>
<body>

<%-- <jsp:useBean id="beanInstanceName" scope="session" class="package.class" /> --%>
<%-- <jsp:getProperty name="beanInstanceName"  property="propertyName" /> --%>
 

<jsp:useBean id="student" class="jsp.Student" scope="session" />
<jsp:setProperty name="student" property="*"/>

Congratulations <%= student.getName() %>, your registration is complete!
<br>
<a href = "beanresults.jsp">Continue</a>

</body>
</html>

<%@page contentType="text/html"%>
<html>
<head><title>JSP Page</title></head>
<body>

<%-- <jsp:useBean id="beanInstanceName" scope="session" class="package.class" /> --%>
<%-- <jsp:getProperty name="beanInstanceName"  property="propertyName" /> --%>
 

<jsp:useBean id="student" class="jsp.Student" scope="session" />

    Your data:<BR>
    Name: <jsp:getProperty name="student" property = "name" /> <BR>
    Year: <jsp:getProperty name="student" property = "year" /> <BR>
    Degree: <jsp:getProperty name="student" property = "degree" /> <BR>

</body>
</html>
 

Created by:  Brandan Jones December 17, 2001