James,
I've done it before.  Use JavaBeans.  Create a bean that has two Strings
and an ArrayList as members.  The strings are used to hold the current
page's name and url.  The ArrayList is used as a stack. Create methods for
pushing and popping breadcrumbs onto the list.  I created an inner class
called Crumb that has a String member for the display text and a String
member for the URL.
Basically, each breadcrumb consists of the text to display and the URL to
the page.  This information is stored as query parameters on the links in
the breadcrumb trail.  When the user navigates to a new page. The page sets
its name and URL in the bean and pushes them on the stack if they are not
already present on the stack.

I used scriptlets to invoke the bean methods.  It could be done more
cleanly if a custom tag was written to do communicate to the bean.


-Richard

At 12:30 PM 9/18/01 -0500, you wrote:
>Friends,
>
>My group is in the process of designing a site that uses breadcrumbs
>throughout. So, for example, towards the top of the page a user will see
>something like the following:
>
>Home --> Product Information --> Widget 5000i --> Architecture
>
>Each section will obviously be a link to the indicated place.
>
>The question I have is if there is a known design pattern that handles
>such a beast. The best answer I have come up with so far is creating a
>table in the database that stores this information, but this seems
>inadequate from a maintenance standpoint: every time a page is added to
>the site a corresponding entry will need to be made in the DB.
>
>Suggestions?
>
>- James Childers
>
>===========================================================================
>To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
>JSP-INTEREST".
>For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
>Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to