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=click
_______________________________________________
struts-menu-user mailing list
[EMAIL PROTECTED]
https://lists.sf.net/lists/listinfo/struts-menu-user

Reply via email to