struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Accessing a Bean from a bean using EL with STRUTS 2 - I really need help
Date Sat, 07 Apr 2007 18:15:45 GMT

All I am trying to do is to retrieve an account from A DB and using 
taglib (data grid) to display the associated invoice with this account. 
Should this be a two-days task.

Maybe something wrong with me.

here's my controller:

package billing;
import com.opensymphony.xwork2.ActionSupport;
public class AccountManager   extends ActionSupport{

    private Account account ;
    private AccountBean accountBean ;
    public String execute()
        account = new Account(accountBean);
        return "SUCCESS" ;

    public AccountBean getAccountBean() {
        return accountBean;

    public void setAccountBean(AccountBean accountBean) {
        this.accountBean = accountBean;

and here's my jsp

<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="ui" uri="/taglibs-datagrid"%>
<%@ taglib uri='' prefix='c'%>

<%@ taglib uri="" prefix="c1" %>
<%@ taglib uri="" prefix="fmt" %>

<%@ page import="billing.*" %>
<%@ page import="java.util.ArrayList"%>
<%@page import="java.util.Collection"%>


<div style="background-color:lightblue;"><s:label value="AccId:" />
<s:property value="accountBean.accountNumber" /> <br>
<s:label value="First Name:" />
<s:property    value="accountBean.firstName" /><br>
<s:label value="Last Name: " />
<s:property    value="accountBean.lastName" />

<jsp:useBean id="accountBean" type="billing.AccountBean" scope="request"

<ui:dataGrid items="${accountBean.invoices}" var="i" name="datagrid1">
                <column width="100" order="true">
                  <header value="ID" />
                  <item   value="${}"/>
</ui:dataGrid >

Now How can I set a bean called invoices to the value of  the bean 
"account.invoices" ?

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message