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 9103821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T01:43:18+00:00 2026-06-17T01:43:18+00:00

Possible Duplicate: Spring Security Authentication is not working as expected in my configuration I

  • 0

Possible Duplicate:
Spring Security Authentication is not working as expected in my configuration

I tried integrating JSF and spring security i spent almost a day but there is no result

Developed an application using JSF,Spring MVC and Primfaces. I am almost done with my requirements, at the end i planned to integrate the spring security but i could n’t and i did enough search on net. I feel it may be bug in related framework.

If anyone of you came across the same please post the solution. I post my approach over here

Step 1:
Created Login.jsp(to have customized login page)
Step 2:
Added below code in my web.xml

<filter>
    <filter-name>springSecurityFilterChain</filter-name>
    <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>

<filter-mapping>
    <filter-name>springSecurityFilterChain</filter-name>
    <url-pattern>/*</url-pattern>
    <dispatcher>FORWARD</dispatcher>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>

Step 3:

Created Springsecurity.xml

<sec:global-method-security
    secured-annotations="enabled" />
<sec:http auto-config="true" use-expressions="true"
    once-per-request="false">
    <sec:intercept-url pattern="pages/secured/**"
        access="ROLE_USER" />
    <sec:form-login login-page="/login.jsp"
        default-target-url="/pages/secured/products.xhtml"
        authentication-failure-url="/login.html?login_error=1" />
    <sec:logout logout-url="/logout" logout-success-url="/login.jsp" />
</sec:http>

<sec:authentication-manager alias="authenticationManager">
    <sec:authentication-provider>
        <sec:user-service>
            <sec:user name="vijay" authorities="ROLE_USER" password="vijay"/>
        </sec:user-service>
    </sec:authentication-provider>
</sec:authentication-manager>

Executed the application and got the login.jsp as first page since i defind in web.xml. On login authentication its forwarding to the Products.xhtml but i could even access the rest of pages which all are comes under the secured folder with out logging in.

Please suggest a better approach or other alternatives.

  • 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-06-17T01:43:19+00:00Added an answer on June 17, 2026 at 1:43 am

    For your access attribute have your tried. Your first slash was missing in the pattern.

    <sec:intercept-url pattern="/pages/secured/**"
        access="hasRole('ROLE_USER')" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: determine target url based on roles in spring security 3.1 Hello all
Possible Duplicate: String comparison in Objective-C I realize that the question is not very
Possible Duplicate: Spring + Hibernate : a different object with the same identifier value
Possible Duplicate: How to implement AOP with Spring i am using spring for hibernate
Possible Duplicate: How can I have case insensitive URLS in Spring MVC with annotated
Possible Duplicate: What is dependency injection? Spring is the framework from where the concept
Possible Duplicate: Warning: format not a string literal and no format arguments I have
Possible Duplicate: Using HTML5 Websockets with Spring i make one application like 2- way
Possible Duplicate: Fluent Security - configuring parameterized controller actions I'm trying out Fluent Security
Possible Duplicate: replace <constructor-arg> with Spring Annotation i would like to replace an XML

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.