struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Levan Dvalishvili" <>
Subject unsibscribe
Date Wed, 04 Apr 2007 13:31:37 GMT

-----Original Message-----
From: Marcello Savino [] 
Sent: Wednesday, April 04, 2007 8:35 AM
To: Struts Users Mailing List
Subject: Iterating over a List of JavaBean

Hi all,
In a jsp file i need to iterate over an ArrayList of javabean :

The bean:

public class myBean implements{
	private Integer code;
	private String name;
	public Integer getCode(){return code;}
	public String getName(){return name;}
	public void setCode(Integer val){ code=val;}
	public void setName(String val){ name=val;}

In the action class i set the form.list variable:
public ActionForward list(
	        ActionMapping mapping,
	        ActionForm form,
	        HttpServletRequest request,
	        HttpServletResponse response)
	        throws IOException, ServletException {
				try {
					myBean[] l;
					for (int i=0;i<l.length;i++){
				} catch (Exception e){
((ActionFormBase)form).ErrMessage=e.getMessage() ;
			return(mapping.getInputForward() );
And this is my jsp code:
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<logic:iterate id="index" name="lista" type="myBean">
	<bean:write name="index" property="code"/>
	<bean:write name="index" property="name"/>

But what i get is an Exception:
java.lang.ClassCastException: [LmyBean;

Any help will be greatly appreciated.
Thanks in advance

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

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

View raw message