• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Struts Jsp Restrictions

 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a jsp, Menubar.jsp
Sample Code below

Now !

What i am trying to do is ,

1. When a user clicks on this link (( in red). this will actually be a link.), i want to check a particular field in the database and allow or disallow the user into this menu

dont know how to do this
can anyone suggest a tutorial to do the same

Might not be exactly what i need, altease which will help me in this

menubar.JPG
[Thumbnail for menubar.JPG]
This is how the above code looks
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please UseCodeTags when posting code or configuration. Unformatted code and configuration is unnecessarily difficult to read. You can edit your post by using the button.
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There are two different issues:

1) Showing the link in the first place.

If the user doesn't have access, they shouldn't see the link at all (or it should be disabled, or etc.) Simple "if" statements work fine for this, or it can be more elaborate, wrapped in a custom tag for clarity, etc.

2) Disallowing access to the page.

Even if the link isn't visible, the user could simply type the URL into the browser bar. There are a lot of ways to deal with this, from server configuration all the way up to a filter, S2 interceptor, Spring Security, and so on. Which is best depends on the app, the environment, the development philosophy where the app is being developed, and so on.
 
reply
    Bookmark Topic Watch Topic
  • New Topic