RE: Need one clarification.

"Matt Raible" <lists-T7vlz3gD7BdF/EzeuO4KJwC/[email protected]>
Newsgroups gmane.comp.java.struts-menu.user
Organization Raible Designs, Inc.
Message-ID <[email protected]>
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: struts-menu-user-admin-TtF/[email protected] 
> [mailto:struts-menu-user-admin-TtF/[email protected]] On Behalf Of 
> Chugh, Dheeraj (Corporate, consultant)
> Sent: Monday, March 29, 2004 3:11 PM
> To: struts-menu-user-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> 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
> struts-menu-user-TtF/[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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.