1. Result is a class from JSTL.  You won't need it unless you are using
JSTL's SQL Tag to grab rows from a database.

I'd recommend using your database access strategy to grab the rows and
put them in some sort of collection.

Matt


> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of 
> Chugh, Dheeraj (Corporate, consultant)
> Sent: Monday, March 29, 2004 3:11 PM
> To: [EMAIL PROTECTED]
> Subject: [struts-menu] Need one clarification.
> 
> 
> Hello,
> 
> In the code below:-
> 1) Result is the user defined class or predefined.
> 2) If it is user-defined code, then can i get the code for 
> getRows() function.
> 
> Thanks,
> Dheeraj.
> 
> Result result = (Result) pageContext.getAttribute("menus");
> Map[] rows = result.getRows();
> for (int i=0; i < rows.length; i++) {
> MenuComponent mc = new MenuComponent();
> Map row = rows[i];
> String name = (String) row.get("name");
> mc.setName(name);
> String parent = (String) row.get("parent_name"); 
> System.out.println(name + ", parent is: " + parent); if 
> (parent != null) { MenuComponent parentMenu = 
> repository.getMenu(parent); if (parentMenu == null) { 
> System.out.println("parentMenu '" + parent + "' doesn't 
> exist!"); // create a temporary parentMenu parentMenu = new 
> MenuComponent(); parentMenu.setName(parent); 
> repository.addMenu(parentMenu); }
> 
> mc.setParent(parentMenu);
> }
> String title = (String) row.get("title");
> mc.setTitle(title);
> String location = (String) row.get("location"); 
> mc.setLocation(location); repository.addMenu(mc); } 
> pageContext.setAttribute("repository", repository); 
> 
> 
> 
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by: IBM Linux Tutorials
> Free Linux tutorial presented by Daniel Robbins, President 
> and CEO of GenToo technologies. Learn everything from 
> fundamentals to system 
> administration.http://ads.osdn.com/?ad_id70&alloc_id638&opĚk
> _______________________________________________
> struts-menu-user mailing list
> [EMAIL PROTECTED] 
> https://lists.sf.net/lists/listinfo/struts-> menu-user
> 




-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
struts-menu-user mailing list
[EMAIL PROTECTED]
https://lists.sf.net/lists/listinfo/struts-menu-user

Reply via email to