Hi,
Following are the bean class,
jsp class and action class used in struts2.
Problem is:-I am displaying data through a request object in jsp class
<s
roperty id="detail" value="#request['custinfo']" />
Through this tag,but it is fetching all the data in request object and displaying.
I have many fields such as
customerBasicInfoVo.setPersBusinessInd("P");
customerBasicInfoVo.setNameLine1("PHILLIP W ROBINSON");
and so on��I want all PersBusinessInd to be displayed in different <td> in jsp and NameLine1 to be in different <td>.
I am not able to do that because everything is in single request object.
�
Is there any way to iterate the values I am entering in the
string buffer�I used list also but again the problem is same all data is being displayed in single <td> only
Bean Class
-------------
public class CustomerDetailedInfoVo {
private CustomerBasicInfoVo customerBasicInfoVo;
private ClientSearchByOlbIdVo clientSearchByOlbIdVo;
public CustomerBasicInfoVo getCustomerBasicInfoVo() {
return customerBasicInfoVo;
}
public void setCustomerBasicInfoVo(CustomerBasicInfoVo customerBasicInfoVo) {
this.customerBasicInfoVo = customerBasicInfoVo;
}
public ClientSearchByOlbIdVo getClientSearchByOlbIdVo() {
return clientSearchByOlbIdVo;
}
public void setClientSearchByOlbIdVo(ClientSearchByOlbIdVo clientSearchByOlbIdVo) {
this.clientSearchByOlbIdVo = clientSearchByOlbIdVo;
}
public String toString(){
StringBuffer str=new StringBuffer();
str.append(this.customerBasicInfoVo.getPersBusinessInd());
str.append(this.customerBasicInfoVo.getNameLine1());
return str.toString();
}
}
JSP Page
------------
<table BORDER="1" CELLPADDING="3" CELLSPACING="1">
<tr>
<td>PersBusinessInd: </td>
<td>
<s
roperty id="detail" value="#request['custinfo']" />
</td></tr>
<tr>
<td>NameLine1:</td>
<td>
</td></tr>
</table>
Action Class
--------------
public String execute() throws Exception {
CustomerDetailedInfoVo customerDetailedInfoVo=new CustomerDetailedInfoVo();
CustomerBasicInfoVo customerBasicInfoVo=new CustomerBasicInfoVo();
customerBasicInfoVo.setPersBusinessInd("M");
customerBasicInfoVo.setNameLine1("ANI");
customerDetailedInfoVo.setCustomerBasicInfoVo(customerBasicInfoVo);
getServletRequest().setAttribute("custinfo", customerDetailedInfoVo);
return SUCCESS;
}