Quiz software, teaching tools, exam revision aids, learning games, courseware authoring
Java Menus
Java menu homeJava downloadBuy a java menuJava menu help centreContact us
Java menus » Java menu knowledge base

 SEARCH

 MENUS BY TYPE

 Drop-down menus

 Animated buttons

 Tree menus

 Sliding menus

 Tab menus

 Image maps

 MENUS BY NAME

 X-Bar menus

 iPOP menus

 iSlide menus

 iTree menus

 iTab menus

 iMMap menus

 Sensomap menus

 Magic menus

 MENU DESIGN

 Menu design

 Drop-down menus

 Web buttons

 Tree menus

 Sliding menus

 Menu tabs

 Image maps

 SITE LINKS

 Home

 Java downloads

 Prices / Buying

 Support

 Company

 Contact

 New menus

 Free menus

 PARTNER SITES

 Alien Menus

 Happy Menus
Java menu knowledge base
Dynamic Indices
Return to knowledge base directory

 
Databases & dynamic indices
 
Using dynamically generated external index files is a powerful and elegant solution.
 
Most of our java menus have a parameter like this:
 
<PARAM name="menufile" value="index.txt">
 
In some applets the parameter name may vary - see documentation.
 
This parameter normally points to a static TXT file on the server with a standard format explained here. However there is no reason why this should be a static TXT file. You can enter any URL of your choice as the value of the menufile parameter. For example:
 
<PARAM name="menufile" value="index_creating_script.pl">
<PARAM name="menufile" value="search.pl?query=concept">
<PARAM name="menufile" value="index.htm">
<PARAM name="menufile" value="index.shtml">
<PARAM name="menufile" value="index.php?user=bob">
<PARAM name="menufile" value="index.jsp">
<PARAM name="menufile" value="imint_index.asp">

 
Please observe the following:
  1. The index source (i.e. your script) must be local to the applet - i.e. it must be in the applet's own directory or a sub-directory of this.
  2. The index source must have a file extension (.pl, .php, .jsp, .asp, etc) which is allowed by the server and must be readable.
  3. The index source must return (via STDOUT) an ASCII stream in the same format as the static TXT files. Usually this is done with a simple sequence of output statements (e.g. PHP's echo statement or perl's print statement). It is a simple as outputting an HTML page - just the format is different.
  4. Ensure that no extra headers are written to the ascii stream as this might currupt the format. For example, a Cold Fusion server might be configured to automatically add headers to anything it generates - you would have to disable this for the script in question.
  5. Query strings can be used (and are useful!).
  6. You are strongly advised to check the format by reading it into a browser window before reading it into an applet. For example, if you point the applet to myMenu.php, point the browser at myMenu.php first to check the format and (!) view the page source - because it's the page source which shows the real format - the browser view itself might hide rogue tags and headers, or not show line breaks correctly. If the browser can't read your script, the applet won't be able to either.
Note that you may also wish to combine dynamic parameter generation and dynamic index generation. For example, a parameter such as:
 
<PARAM name="menufile" value="search.pl?query=concept">
 
...could be dynamically manipulated by a client-side script using, for example, conditional document.write() statements.

 
java menu