Thanks, I'll check it out.

----- Original Message ----- 
From: "David Schwartz" <[EMAIL PROTECTED]>
To: "'Tag Libraries Users List'" <[EMAIL PROTECTED]>
Sent: Friday, April 09, 2004 10:52 AM
Subject: RE: Recursive Functionality with Tags


> Oracle has built-in func to return a query result in hierarchy/tree
format.
> I'm not familiar with mySQL, but you should be able to write a query that
> returns the tree then simply output in jstl.
>
> David Schwartz
>
> -----Original Message-----
> From: Jeff Brewer [mailto:[EMAIL PROTECTED]
> Sent: Friday, April 09, 2004 10:21 AM
> To: Tag Libraries Users List
> Subject: Re: Recursive Functionality with Tags
>
> +-------------+--------------+------+-----+---------+----------------+
> | Field       | Type         | Null | Key | Default | Extra          |
> +-------------+--------------+------+-----+---------+----------------+
> | issue_id    | int(11)      |      | PRI | NULL    | auto_increment |
> | name        | varchar(255) | YES  |     | NULL    |                |
> | description | text         | YES  |     | NULL    |                |
> | parent      | int(11)      | YES  |     | NULL    |                |
> | public      | tinyint(4)   | YES  |     | 1       |                |
> +-------------+--------------+------+-----+---------+----------------+
> 5 rows in set (0.01 sec)
>
> "parent" is the "issue_id" number of the parent record
> ----- Original Message -----
> From: "David Schwartz" <[EMAIL PROTECTED]>
> To: "'Tag Libraries Users List'" <[EMAIL PROTECTED]>
> Sent: Friday, April 09, 2004 10:37 AM
> Subject: RE: Recursive Functionality with Tags
>
>
> > Oracle?
> >
> > David Schwartz
> >
> > -----Original Message-----
> > From: Jeff Brewer [mailto:[EMAIL PROTECTED]
> > Sent: Friday, April 09, 2004 10:12 AM
> > To: Tag Libraries Users List
> > Subject: Re: Recursive Functionality with Tags
> >
> > Yes
> > ----- Original Message -----
> > From: "David Schwartz" <[EMAIL PROTECTED]>
> > To: "'Tag Libraries Users List'" <[EMAIL PROTECTED]>
> > Sent: Friday, April 09, 2004 10:29 AM
> > Subject: RE: Recursive Functionality with Tags
> >
> >
> > > Is your item list coming from a database?
> > >
> > > David Schwartz
> > >
> > > -----Original Message-----
> > > From: Jeff Brewer [mailto:[EMAIL PROTECTED]
> > > Sent: Friday, April 09, 2004 10:00 AM
> > > To: [EMAIL PROTECTED]
> > > Subject: Recursive Functionality with Tags
> > >
> > > I'm new to Tags and still hip-deep in getting my first JSP project off
> the
> > > ground and very much appreciate all the great support in this forum.
> Thank
> > > You! My question is at the end of all this (in case you want to skip
> over
> > > the rest)...
> > >
> > > **BACKGROUND
> > > I have an "outline" or "directory" type structure that consists of an
> > > ArrayList that contains objects that have ArrayLists full of the same
> kind
> > > of objects that each have ArrayLists full of.... and so on. I want my
> HTML
> > > page to look something like this with each sub-item indented:
> > >
> > > FIRST ITEM
> > >      FIRST SUB-ITEM
> > >      SECOND SUB-ITEM
> > >           FIRST SUB-ITEM
> > >      THIRD SUB-ITEM
> > > SECOND ITEM
> > > THIRD ITEM
> > >      FIRST SUB-ITEM
> > > FOURTH ITEM
> > >
> > > **CURRENT SOLUTION
> > > I made this work on my JSP page using the following code:
> > >
> > > <%
> > >      // get the ArrayList from the request
> > >      ArrayList al = (ArrayList) request.getAttribute("issuesList");
> > > %>
> > > <%=writeIssues(al, new String(), 50) // call the writeIssues
function -
> > > returns the outline%>
> > > <%!
> > > String writeIssues(ArrayList al, String myOutput, int indent) {
> > >     // sort the array list alphabetically
> > >     Collections.sort(al);
> > >      Iterator iter = al.iterator();
> > >      Issue myIssue = null;
> > >      while (iter.hasNext()) {
> > >           myIssue = (Issue) iter.next();
> > >          // append the string with this issue title
> > >           myOutput = new String(myOutput + "<p style=\"margin-left: "
+
> > > indent + ";\">" + myIssue.getName() + "</p>\n");
> > >           // recurse by passing this issue's ArrayList, the
ever-growing
> > > string, and a new indent value
> > >           myOutput = new String(writeIssues(myIssue.getChildren(),
> > myOutput,
> > > indent + 50));
> > >      }
> > >      return myOutput;
> > >  }
> > > %>
> > >
> > >
> > > **QUESTION
> > > Can I do this somehow in JSTL?
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> > >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to