<%@ page import="java.util.*;" %> <%-- //################################ //#FILE: popcorn_basic.jsp - Version 1.2 //# //#REVISION HISTORY: //# 05/29/04 Version 1.2 Original release //# //#CONTACT INFORMATION: //# http://www.davelozinski.com/cgi-bin/email_lozinski.pl //# //#UPGRADE TO THE ADVANCED VERSION: //# http://www.davelozinski.com/scripts/popcorn_trail/ //# //# This jsp script generates a "popcorn" trail on your web page. --%> <% //################################ //# Just insert this code once at the top of the web page you'd like the //# "popcorn" trail displayed in StringTokenizer currentPath = new StringTokenizer(request.getRequestURI(),"/"); int UpperBound = currentPath.countTokens(); String[] trail = new String[UpperBound]; String path = ""; int x = 0; while (currentPath.hasMoreTokens()) { trail[x] = currentPath.nextToken(); x += 1; } //################################ %> Popcorn Trail Test
There should be a popcorn trail below:

<% //################################ //# Insert this code wherever you want your "popcorn" trail displayed path = ""; for (x=0; x<(trail.length); x++) { path += "/" + trail[x]; out.println (" -> " + trail[x] + ""); } //################################ %>

Like this script?
Go to: http://www.davelozinski.com/scripts/popcorn_trail/ and upgrade to the "Advanced" version with the following features:

Customize directory and file names!
In the "basic" version, items in the trail are listed as they're spelled on your server.
In the "advanced" version, tell the program who you want the items in your "trail" named!

For example:
-> Home -> Scripts -> Popcorn Trail -> Popcorn Code
in place of:
-> / -> php_scripts -> popcorn -> popcorn_code.php

Easily Specify Multiple Trails with Multiple Settings on the same page or multiple pages with only ONE copy of the code!
At the top of your page, you might have your trail look like:
-> Home -> Scripts -> Popcorn Trail -> Popcorn Code
At the bottom of the page, you might have a different view such as:
Home | Scripts | Popcorn Trail | Popcorn Code

Have your trail end at the last directory OR actual file calling the code!
Do you want your trail to extend to the file currently being viewed? Or just the last directory? Easily set this for each trail!
For example:
/ -> php_scripts -> popcorn -> popcorn_code.php
OR
/ -> php_scripts -> popcorn

Have multiple trails, each with its own "separator", including images!
You can use the default trail item separator of "->", or specify your own! And you can have a different separator for each trail on your page!

For example:
Home -> Scripts -> Popcorn Trail -> Popcorn Code
AND
Home | Scripts | Popcorn Trail | Popcorn Code

Have the trail separator start before OR after the first item!
For example:
-> Home -> Scripts -> Popcorn Trail -> Popcorn Code
OR
Home -> Scripts -> Popcorn Trail -> Popcorn Code