Greetings !!!
This is my first attempt at Web based development. The problem I am about to
post is a fundamental requirement of any application and am sure the issue
have beaten to death in this forum. So I am hoping for a quick reply. Here
it goes:-
1) I instantiate a bean in a servlet and populate it - works fine
2) I pass the bean to a JSP which then displays it - works fine
3) User updates the displayed data and JSP passes the updated bean back to
servlet. However the servlet receives the old data, not the updated values
Relevant servlet code
=====================
HttpSession session = request.getSession();
app.BscmDataEntryBean changedBean = (app.BscmDataEntryBean)
session.getAttribute("dataentry");
String[] changedColValues=
changedBean.getcolumnValue();
System.out.println("before displaying new values");
System.out.println("new value is " + changedColValues[0]);
System.out.println("new value is " + changedColValues[1]);
System.out.println("new value is " + changedColValues[2]);
Relevant JSP code
=================
<!--
Displays data for update that came from BscmGetReportServlet
-->
<%@ page language="java" contentType="text/html" %>
<%@ page info="report request page" %>
<html>
<head><title>Report Selection</title></head>
<body bgcolor="gray">
<jsp:useBean id="dataentry" class="app.BscmDataEntryBean" scope="session" />
</jsp:useBean>
<form action="/bscm/BscmDataEntryServlet" METHOD="POST">
<TABLE>
<%
String[] columnNames = dataentry.getcolumnNames();
int numCol = dataentry.getnumCol();
String[] xcolumnValue= dataentry.getcolumnValue();
%>
<%
for (int j=0; j < numCol; j++)
{
%>
<TR> <TD>
<% out.println(columnNames[j] );
%>
</TD><TD> </TD> <TD><input type="text" name=xcolumnValue[j]
value="<%= xcolumnValue[j] %>"> </input></TD> </TR>
<% };
%>
<TR></TR><TR>
<TD COLSPAN=3> <input type="submit" name="submit" value="process"> </TD>
<jsp:setProperty name="dataentry" property="columnValue" param=
"xcolumnValue" /> </TR>
</TABLE>
</form>
</body>
</html>
I suspect that the JSP does not update the bean, before passing it back to
servlet.
Any help will be greatly appreciated.
Sanjay Jain
-----Original Message-----
From: Doug Turner [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 03, 2001 4:20 PM
To: [EMAIL PROTECTED]
Subject: Re: Difference between Date Objects
===========================================================================
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://archives.java.sun.com/jsp-interest.html
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.jsp
http://www.jguru.com/faq/index.jsp
http://www.jspinsider.com
***********************************************************************
Bear Stearns is not responsible for any recommendation, solicitation,
offer or agreement or any information about any transaction, customer
account or account activity contained in this communication.
***********************************************************************
===========================================================================
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://archives.java.sun.com/jsp-interest.html
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.jsp
http://www.jguru.com/faq/index.jsp
http://www.jspinsider.com