• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

dyanmic left navigation menu?

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
I have to design a left navigation jsp page for my website. this page will be included in all rest of the jsp pages.

I am storing the links of other jsp's in database my database table for storing link is somewhat like this :

Link_Id varchar(36)
LinkTxt varchar(50)
ParentItem varchar(6)
Level int(1)
isSubLevel tinyint(1)
PageLink varchar(150)

I am not getting any idea to write a query to retrieve particular link and its submenu items.
I am not getting any idea that what data type i should use, to store the links and its submenu links and send the data to jsp page.

please provide me with some idea or provide some link to solve this problem.
[ October 05, 2005: Message edited by: Bear Bibeault ]
 
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
varchar would work fine.

Use a select query and give a condition into that. Where is the problem?
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just re-think.

My suggestion is to split it into two tables. One for the main link, and other is for sub-links then make primary-foreign relationship. You can use joins to get all.
[ October 05, 2005: Message edited by: Adeel Ansari ]
 
Ranch Hand
Posts: 3640
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Look for XML based tree, as it is not good idea to make a call to database to get tree hierarchy with each click on tree node item.

Create XML data based on the database on the startup of the application. Put it in to application scope.

As user login in the system, take XML data from application scope, filter it as per the permission that a particular user has and than put the filtered XML data in session scope of the user and render the XML data to generate tree.

Check following link, they may useful to you.

Build an XML-based Tree Control with JavaScript
http://www.xml.com/pub/p/254]XTree (XML-based tree)
http://www.treemenu.org/]Morten’s JavaScript Tree
[ October 05, 2005: Message edited by: Chetan Parekh ]
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Dee_Singh" -

Welcome to the JavaRanch! Please adjust your displayed name to meet the
JavaRanch Naming Policy. User names cannot be obviously fake and must constist of a first name and a last name.

Primarily, why did you put an underscore instead of a space between your first and last name?

You can change your user name here.

Thanks! and welcome to the JavaRanch!
 
reply
    Bookmark Topic Watch Topic
  • New Topic