I have create a bean to collect data from a form on a jsp page. When I attempt to 
collect the data with the scope of the bean set to request, it works fine. If I change 
the scope to session, the bean doesn't collect the data. Below is my code on the jsp 
page.

<%@page contentType="text/html"%>
<%@ taglib uri="http://jakarta.apache.org/taglibs/utility"; prefix="ut" %>
<%@ page import="java.util.*" %>
<html>
<head><title>New Action</title></head>
<body>

<jsp:useBean id="aB" scope="session" class="actBean" >
 <jsp:setProperty name="aB" property="date" />
 <jsp:setProperty name="aB" property="action" />
 <jsp:setProperty name="aB" property="originator" />
</jsp:useBean>


<FORM method="POST" action='newaction.jsp' >
<TABLE border=1 cellpadding=5>
    <TR>
        <TH>date</TH>
        <TH>action</TH>
        <TH>originator</TH>
        <TH>A</TH>
    </TR>
    <TR>
        <TD><INPUT type="text" name="date" value="<%= aB.getDate() %>"></TD>
        <TD><INPUT type="text" name="action" value="<%= aB.getAction() %>"></TD>
        <TD><INPUT type="text" name="originator" value="<%= aB.getOriginator() 
%>"></TD>
        <TD><INPUT type="submit" name="test" value="add"></TD>
    </TR>

        <TR>
            <TD>
            <TD><INPUT type="submit" name="test" value="enter" ></TD>

            <TD></TD>
        </TR>
 </TABLE>


</FORM>
</body>
</html>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to