• 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
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

Dynamic Javascript and Spring

 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using Spring with JSTL to present information on a web page. I will need to build a tabbed menu dynamically based on user credentials. For example one user may end up with 4 tabs and another with 2. I could do this rather easily with ASP.NET by injecting dynamic javascript into the asp.net page event. But I am not sure how I would do this in Spring and JSTL. Any help is appreciated.
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
[quote=Charles Owen]I am using Spring with JSTL to present information on a web page. I will need to build a tabbed menu dynamically based on user credentials. For example one user may end up with 4 tabs and another with 2. I could do this rather easily with ASP.NET by injecting dynamic javascript into the asp.net page event. But I am not sure how I would do this in Spring and JSTL. Any help is appreciated.[/quote]

With Spring Security it is extremely easy. Just use the Spring security tag library in your page. <security:ifAnyGranted={}> That isn't the exact tag, but the tag is just like that and anything between the open and close tag will only appear if the user has any of the roles stated in the tag for ifAnyGranted, that you write.

Mark
 
Bartender
Posts: 1682
7
Android Mac OS X IntelliJ IDE Spring Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is a link to the Spring Security documentation on JSP tag libs

Tag lib documentation

It is also useful to note that you can use SPEL which makes it even more powerful as Craig Walls pointed out in THIS POST
 
Charles Owen
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We resolved this by creating a tiles definition for the tabs, then using a combination of CSS, Javascript, and JSTL.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic