aspose file tools*
The moose likes Spring and the fly likes Dynamic Javascript and Spring Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Dynamic Javascript and Spring" Watch "Dynamic Javascript and Spring" New topic
Author

Dynamic Javascript and Spring

Charles Owen
Ranch Hand

Joined: Aug 31, 2009
Posts: 61
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.
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17256
    
    6

[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
Bill Gorder
Bartender

Joined: Mar 07, 2010
Posts: 1666
    
    7

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


[How To Ask Questions][Read before you PM me]
Charles Owen
Ranch Hand

Joined: Aug 31, 2009
Posts: 61
We resolved this by creating a tiles definition for the tabs, then using a combination of CSS, Javascript, and JSTL.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Dynamic Javascript and Spring