You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Matthew Van Horn <ho...@accesstech.com> on 2003/06/04 11:39:22 UTC

struts-el question

How do I access the form bean properties from my jsp page?

I have a property called columns which is a String[] array.
I'd like to do the equivalent of the following using tags.

<%
String[] myArray = myForm.getColumns();
for (int i=0; i < myArray.length; i = i+7) {
	out.print("<TR>");
	for (int j=0; j < 7; j++) {
		out.print("<TD>"+ myArray[(i*7)+j] +"</TD>");
	}
	out.print("</TR>");
}
%>

I tried this (saw it online) -  but I get an error about accessing the 
columns property.

<c:forEach var="row" begin="0" items="${myForm.columns}" step="7">

If it matters, columns is inherited from a BaseForm class.

Thanks for helping,
Matt

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: struts-el question

Posted by David Chelimsky <da...@chelimsky.org>.
Can you post the block using tags and the error?

Matthew Van Horn wrote:

> How do I access the form bean properties from my jsp page?
>
> I have a property called columns which is a String[] array.
> I'd like to do the equivalent of the following using tags.
>
> <%
> String[] myArray = myForm.getColumns();
> for (int i=0; i < myArray.length; i = i+7) {
>     out.print("<TR>");
>     for (int j=0; j < 7; j++) {
>         out.print("<TD>"+ myArray[(i*7)+j] +"</TD>");
>     }
>     out.print("</TR>");
> }
> %>
>
> I tried this (saw it online) -  but I get an error about accessing the 
> columns property.
>
> <c:forEach var="row" begin="0" items="${myForm.columns}" step="7">
>
> If it matters, columns is inherited from a BaseForm class.
>
> Thanks for helping,
> Matt
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org