hi JavaRanchers
My problem is i m not getting how to use
jsp:useBean in
Struts Jsp.
i m setting javabean object in action in request and wanna use in jsp, ( reason i m goin away from Struts because i m finding a way to use 2 form for one action, and both this forms are interdependent )
here is the code whaich i wrote,
after running it i m getting [ ="<%contactDetails.getEmployerFname()%>" ] in text box.
JSP
-------------------------
<jsp:useBean id="contactDetails" scope="request" class="com.bitwise.smart.obj.ContactDetailsInfo" type="com.bitwise.smart.obj.ContactDetailsInfo">
<html:text property="txtEmployerFname"
value="<%contactDetails.getEmployerFname()%>" size="30" maxlength="30" tabindex="0"/>
</jsp:useBean>
Action
---------------------------------
contactDetailsInfo=employerbean.getContactDetails(sEmployerId,sContactId);
request.setAttribute("contactDetailsInfo", contactDetailsInfo);
EmployerBean
-------------
in this class
rs = stmt.executeQuery("SELECT CONTACTFNAME FROM EMPCONTACTINFO WHERE EMPLOYERID = '" + p_sEmployerId + "' AND CONTACTID = '" + p_sContactId +"'");
while(rs.next())
{
contactDetailsInfo = new ContactDetailsInfo();
contactDetailsInfo.setEmployerFname(rs.getString("CONTACTFNAME"));
}
ContactDetailsInfo
-----------------
it's
java Bean
having property :
private
String sEmployerFname= null;
Thanks
keviv