Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Dynamic Menu duplicates everytime a link is clicked  RSS feed

 
Shahid Kahn
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have following code to populate a dynamic menu from categories retrieved from database


It works fine. But every time I click on a link on the menu, it duplicates the whole menu. Please tell what's wrong in my code.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66184
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What happens on a click? Is the page reloaded? Is some JavaScript executed?

Your inappropriate use of application scope for page-specific processing is suspect.
 
Shahid Kahn
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Should I set scope for "category" and "catList" to Page? How does the scope making effect here? Could please explain for me?
 
Shahid Kahn
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the code in separate jsp file which is added as menu in every page. I think this information might help you suggest me right solution.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!