You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Zayed <st...@netscape.net> on 2002/07/04 08:45:03 UTC

Handling loop --

Hi,
 
What is the best way to handle the following sample scenario in struts.
I am listing all the Students in a class. A click on the Student Name 
takes me to studentDetails.jsp

<%
    String studentName = null;
    for(int i=0 ; i < studentArray.length ; i++) {
        studentName = studentArray[i];
%>
            <a 
href="studentDetail.jsp?<%=Constants.STUDENT%>=<%=URLEncoder.encode(studentName)%>"> 

                <%= studentName %>
            </a>
<%
    }
%>

I am a newbie to struts and coudn't find any examples implementing such 
scenario. (please let me know if there are any).
It would be great to have a running example (xxxAction , yyyForm etc)

Thanks in  advance.

Zayed




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Handling loop --

Posted by Zayed <st...@netscape.net>.
Hi,
Typo in my previous mail...
Please read the second line as

I am listing all the Students in a jsp . A click on the Student Name 
takes me to studentDetails.jsp

strutsdev@netscape.net wrote:

> Hi,
>
> What is the best way to handle the following sample scenario in struts.
> I am listing all the Students in a class. A click on the Student Name 
> takes me to studentDetails.jsp
>
> <%
>    String studentName = null;
>    for(int i=0 ; i < studentArray.length ; i++) {
>        studentName = studentArray[i];
> %>
>            <a 
> href="studentDetail.jsp?<%=Constants.STUDENT%>=<%=URLEncoder.encode(studentName)%>"> 
>
>                <%= studentName %>
>            </a>
> <%
>    }
> %>
>
> I am a newbie to struts and coudn't find any examples implementing 
> such scenario. (please let me know if there are any).
> It would be great to have a running example (xxxAction , yyyForm etc)
>
> Thanks in  advance.
>
> Zayed
>
>
>
>
> -- 
> To unsubscribe, e-mail:   
> <ma...@jakarta.apache.org>
> For additional commands, e-mail: 
> <ma...@jakarta.apache.org>
>