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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:22:24+00:00 2026-06-11T01:22:24+00:00

I have a web flow project I been working on and now its time

  • 0

I have a web flow project I been working on and now its time to add some security to it. I have the login screen working for the demo but I want to add:

@PreAuthorize(isAuthenticated());

To some of my functions in the control, service and dao so I know only signed in users are access the functions. @PreAuthorize(isAuthenticated()) does not work and I really dont want to use @PreAuthorize(“hasRole(‘ROLE_USER’)”).

Can someone please tell me how to lock down my code better

here is my security.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<beans:beans 
    xmlns="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.1.xsd
                        http://www.springframework.org/schema/security
                        http://www.springframework.org/schema/security/spring-security-3.1.xsd">


    <global-method-security pre-post-annotations="enabled"/>

    <http use-expressions="true">
        <intercept-url access="hasRole('ROLE_USER')"    pattern="/visit**" />
        <intercept-url pattern='/*' access='permitAll' />
        <form-login   default-target-url="/visit" />

        <logout logout-success-url="/" />
    </http>

    <authentication-manager>
        <authentication-provider>
            <user-service>
                <user name="user" password="user" authorities="ROLE_USER" />
            </user-service>

        </authentication-provider>
    </authentication-manager>
</beans:beans>
  • 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-11T01:22:26+00:00Added an answer on June 11, 2026 at 1:22 am

    Try putting isAuthenticated() in quotes.

    As in

    @PreAuthorize("isAuthenticated()");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Now I'm working on a spring web-flow unit test. I have to retrieve HttpServletRequest
I have web service urls that were working fine and are now returning the
I have web service, which use integrated security in IIS. Now, I want to
I have been trying this for some time but could not figure out yet.
I am working on a project using Spring Web Flow 2.0. I am trying
I am working on a web app project that has been in development for
I am now currently working on a grails project . I have a problem
I have this web application using Spring Web Flow framework. In my main page
I'm using Spring Web Flow (v. 1.0.5) and I have a JSP page that
We have to do a project which is a web based workflow application. I

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.