Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How can i reuse My menu panel in jsp ?

 
sreejith sree
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have 4 jsp pages , in every pages i have the same menu (navigation menu)
with home , about me , contacts, photo gallery,

i want to know if there any option , jsp gives me to store this menu in one place and reuse this menu control in every page ,

some thing like this.

<jsp use menu ="menu1" >


i dont know much abt jsp , but .net , i have custom user control ,

i cant put menu in user control and call on any aspx page,

kindly tell me , if there is any option in jsp ...
 
Shikhar Madhok
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
.Net is greek and latin to me.
The best way of reusing the menu would be to separate the piece of code geenrating the menu into a separate jsp and include that jsp in each of your other 4 jsps ussing the <include> tag.

This was your code is being reused and is clean.

HTH
Shikhar
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We have an article in our JSP FAQ that covers the two types of includes provided by JSP.
http://faq.javaranch.com/java/IncludesActionDirective

You might also want to look into JSP tag files, which are custom tags that can be written in JSP syntax.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic