• Post Reply Bookmark Topic Watch Topic
  • New Topic

dyanmic left navigation menu?  RSS feed

 
Dee_Singh
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • 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 ]
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • 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
  • 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 ]
 
Chetan Parekh
Ranch Hand
Posts: 3640
  • Mark post as helpful
  • send pies
  • 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 ]
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • 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!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!