Hi,
I am confused about setting up the Bean to be called from jsp.
I want a bean called page1, called from page1.jsp with variables:
rfcoverten, rfcoverage, rfcoverflt.
Are the variables stored in the bean created in bean called page1.java
or stored in another file.
Is the Primary key set as a string not int??
I have a database connection file SqlDB.java that connects to the
page.
With a method(?) connect
public bollean connect() throws classNotFoundException, SQlException{
Class.forName(dbDriver);
dbcon = DriverManager.getConnection(dbURL);
return true;
}
In JSP I can call the 'method' by using a scriplet
<%
SqlDB.connect();
%>
How do I access the SqlDB.connect method in the bean to retrieve and
store
the information, so that I can retrieve it in the jsp
<!--page1.java
-->
public class page1{
private string surID ="null";
private int rfcoverten = 0;
private int rfcoverage = 0;
private int rfcoverfl = 0;
public String getsurID(){
return(getsurveyID)
}
public void setsurID(String surID){
if (surID != null){
this.surID = surID;
}
}
public int getrfcoverten(){
return(rfcoverten);
}
public void setrfcoverten(int rfcoverten){
this.rfcoverten = rfcoverten
}
}
<!-- page1.jsp
-->
<jsp:useBean id="page1" class="page1" />
<td><jsp:getProperty name="*" property="page1.rfcoverten"/> </td>
<td><jsp:getProperty name="*" property="page1.rfcoverage"/> </td>
<td><jsp:getProperty name="*" property="page1.rfcoverfl"/> </td>
<!-- end page1.jsp
-->