Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6607065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:27:46+00:00 2026-05-25T19:27:46+00:00

I use Spring and Spring Security 3 at my application. All my clients side

  • 0

I use Spring and Spring Security 3 at my application. All my clients side are static HTML files. I have a navigation bar that includes buttons like:

  • List
  • Edit
  • Delete
  • Update

When a user clicks any of them another page loads at bottom. Users have roles at my application. Some users do not have edit and delete authorization, while others do. That buttons should be visible to users which have the authorization. If a user doesn’t have edit the correct permission he/she must not see the edit button. I have the buttons defined in an HTML file: navigation.html. I figured out that: there will be many navigation.html files. One of them includes all buttons(for admin) one of them just includes list button. If a user requests that navigation.html I want to send the correct one. So I can have that ability:

<logout logout-url="/j_spring_security_logout" logout-success-url="/login.html"/>

similar to that user will request that file from an URL(as like /navigation). There will be a controller to handle it so will return any of that navigation files.

Does that design sound correct? If so, how can I implement that? Any other simple solutions are welcome I am new to Spring and Spring Security.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T19:27:47+00:00Added an answer on May 25, 2026 at 7:27 pm

    For general Spring Security use, you don’t need to write your own code to enable authorization. I generally configure Spring Security in XML to control access at a gross level to various resources based on Roles. Then, I annotate the controllers and/or handler methods to restrict more precisely.

    Example:

    <?xml version="1.0" encoding="UTF-8"?>
    
    <beans:beans 
        xmlns:security="http://www.springframework.org/schema/security"
        xmlns:beans="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
                        http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd">
    
        <security:global-method-security secured-annotations="enabled">
        </security:global-method-security>
    
        <security:http auto-config="true" disable-url-rewriting="true">
           <security:intercept-url pattern="/*.do" access="ROLE_USER" />
           <security:intercept-url pattern="/index.jsp" access="ROLE_USER" />
           <security:intercept-url pattern="/**" access="IS_AUTHENTICATED_ANONYMOUSLY" />
           <security:intercept-url pattern="/login.jsp" filters="none" />
           <security:form-login login-page="/login.jsp" />
           <security:logout />
        </security:http>
    
        <security:authentication-manager>
            <security:authentication-provider>
                <security:password-encoder hash="md5" />
                <security:jdbc-user-service data-source-ref="my-ds"/>
            </security:authentication-provider>
        </security:authentication-manager>
    
    </beans:beans>
    

    And then in the Controller:

    @Secured({"ROLE_SPECIAL_USER"})
    @RequestMapping("/somespecial.do")
    

    Within a JSP:

    <%@ taglib prefix="authz" uri="http://www.springframework.org/security/tags" %>
    <authz:authorize ifAnyGranted="ROLE_SPECIAL_USER">
       ...some special JSP code...
    </authz:authorize>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web application secured with Spring Security that needs two separate login
I have an application that uses Spring Security to control access to pages, to
I use Spring MVC [version: 2.5] and Security[version: 2.0.4]. My problem looks like that:
We have started to use spring aop for cross cutting aspects of our application
I have a 3 tier application that requires security authorizations be placed on various
I need to use Spring Security 3 in my application which is composed by
greetings all, i am using spring security 3.0.2, urlRewrite 3.1.0 , and i have
I am writing an application that uses GWT, some Spring MVC and Spring Security.
In Spring application, I set up app-security.xml to controll all the security issues. However,
I have implemented Spring Security in my application. I have used default implementation, i.e.,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.