jsp and beans
I am using Sun JDK 1.5.0_09, Tomcat 5.5.17, MySQL 5.0 .
I am gathering data from a webpage using jsp. Beans are handling the database operations. I have tested the Bean code and it correctly adds data to the database table.
For some reason the data entered in the jsp page is not entered in the database so i suspect the error is in the jsp (..maybe....)?
Any suggestions ? Thanks in advance.
The jsp code is below :
AddChain.jsp
******************************************************************************
<jsp:useBean id="ChainInfoBean" class="com.bean.ChainInfoBean" scope="request"/>
<jsp:useBean id="GiftData" class="com.bean.dataBase" scope="session" />
<jsp:setProperty name="ChainInfoBean" property="*"/>
<html>
<head><title>Add Chain</title></head>
<body bgcolor="white">
<h2>Chain Information</h2>
<form ACTION="../gift/AddChain.jsp" method=POST>
<P>
Chain Name <input type="text" name="chainName" value="" size=50 maxlength=50>
<P>
Address 1 <input type="text" name="address1" value="" size=50 maxlength=50>
<P>
Address 2 <input type="text" name="address2" value="" size=50 maxlength=50>
<P>
City <input type="text" name="city" value="" size=50 maxlength=50>
<P>
State <input type="text" name="state" value="" size=2 maxlength=2>
<P>
Zipcode <input type="text" name="zipCode" value="" size=9 maxlength=9>
<P>
Phone Number <input type="text" name="phoneNumber" value="" size=10 maxlength=10>
<input type="submit" value="Submit">
<input type="reset" value="Reset">
</form>
<%
if (request.getMethod().equals("POST") ) {
out.println("POST");
String [] results;
// String ResponseCode;
GiftData.init();
results = GiftData.addChain("E",
ChainInfoBean.getchainName(),
ChainInfoBean.getaddress1(),
ChainInfoBean.getaddress2(),
ChainInfoBean.getcity(),
ChainInfoBean.getstate(),
ChainInfoBean.getzipCode(),
ChainInfoBean.getphoneNumber()
);
}
%>
</body>
</html>

