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

  • Home
  • SEARCH
  • 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 8795975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:30:47+00:00 2026-06-13T23:30:47+00:00

My application is based on Spring 3, Hibernate 3, MySQL. I read the Spring

  • 0

My application is based on Spring 3, Hibernate 3, MySQL. I read the Spring Security document and learnt that I can implement Authentication as given below,

<authentication-manager>
   <authentication-provider>
    <jdbc-user-service data-source-ref="dataSource"

       users-by-username-query="
          select username,password, enabled 
          from users where username=?" 

       authorities-by-username-query="
          select u.username, ur.authority from users u, user_roles ur 
          where u.user_id = ur.user_id and u.username =?  " 

    />
   </authentication-provider>
</authentication-manager>

I understood above part but my concern is, in my application user table doesn’t only store the userName, password and enabled field. It also stores first and last name, emailID, phone etc. On successful authentication, I want next jsp to populate all user details automatically and not ask user the same information which it will ask to non-regirstered user.

  1. I want to use annotation based configuration and not xml based (unlike
    mentioned in spring 2.5 examples)
  2. spring document doesnt use hibernate for security. Should i use
    hibernate or jdbc-user-service? if hibernate then how?
  3. I saw couple of examples use customized UserService. Is that I need
    to do as well?

Can someone kindly advice with good examples? any references to other posts will help too.

  • 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-13T23:30:48+00:00Added an answer on June 13, 2026 at 11:30 pm

    As for now Spring Security is mostly configured without annotations, but you can use special XML namespace for simple customization of Spring Security.

    You need to implement your own UserDetailsService which will be responsible for loading details of the user from persistent store.

    UserDetailsService interface has just one method

    UserDetails loadUserByUsername(String username) throws UsernameNotFoundException;
    

    After implementing and creating bean of your component you need to inject it:

    <authentication-manager>
       <authentication-provider user-service-ref="myUserDetailsService"/>
    </authentication-manager>
    

    More in Spring Security Docs:

    http://static.springsource.org/spring-security/site/docs/3.1.x/reference/springsecurity-single.html#tech-userdetailsservice

    http://static.springsource.org/spring-security/site/docs/3.1.x/reference/springsecurity-single.html#nsa-authentication-provider

    If you don’t have information like enabled in your database, you will always have to put true value in your UserDetails object for that field.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The environment of my application: web-based, Spring MVC+Security, Hibernate, MySQL(InnoDB) I am working on
I have an application that is based on Swing, Spring 2.5.2, Hibernate 3.3.1. If
We've got a Spring based web application that makes use of Hibernate to load/store
I am using Spring/Hibernate and Spring-Security for my web-based application. Now I have a
I am building a spring based application that handles server-side game management for a
I have a localized spring mvc based web application, that has an externalized messages
I'm developing a web application based on JPA + Hibernate, Spring and Wicket. I
I am building a category-based web application multilanguage using JPA/Hibernate + Spring I currently
Our application is based on spring, JPA, Hibernate (3.5.1), postgresql 8.4 We will deliver
I am trying to deploy Spring - Tiles - Hibernate based application in WebSphere

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.