Saturday , August 19 2017
Home / Spring / Spring MVC Login Form Example Tutorials

About chandrashekhar

Hi Folks, you have reach this so far, that shows you like what you are learning. Then why don't you support us to improve for bettor tutorials by leaving your valuable comments and why not you keep in touch with us for latest updates on your favorite blog @ facebook , twitter , Or Google+ ,

Recommended

Spring Bean Autowire ByType Example

In this tutorial, we are going to learn about one of the autowire strategy in …

17 comments

  1. 9kulal@gmail.com'

    good one..here in the example there is one user where he is logging and getting the result.my query is if there are multiple users and each users are having different permisions and with specified page.please share such examples.

    • Hi Vishwanath,

      Thank you for your comment. Can you please explain your query in detail, so that I can help you better.

      Thankyou,
      Chandrashekhar

      • virendra.gulhane@live.com'

        Very well demonstrated by you Mr. Chandrashekhar… Nice to have it. 🙂

      • ravichandra.eee12@gmail.com'

        Hi Chandra….

        Very good example for beginners to understand spring MVC…. but can you explain us how to connect it with data base like HSQLDB like that…. because working with data base is necessary in projects….

    • virendra.gulhane@live.com'

      @Vishwanath
      I think you are wondering about the system which have users with multiple role types such as client, admin, superadmin for example.
      For such scenario you have to follow the same steps as Mr. Chandrashekhar has described, addition to that follow as,
      Step 1: Retrieve user roles from DB as per authentication from your DAO layer.
      Step 2: In Service layer, filter the return value for your view page based on the the user role you retrieved from DB for specific login credentials to your controller class. E.g.

      if(users.getUserRole.equals("amin"))
      {
      return "Admin";
      }
      if(users.getUserRole.equals("client"))
      {
      return "Client";
      }

      Step 3: And eventually, just return that same view name to ViewResolver which you received from Service layer.

      Step4; DONE… ViewResolver will properly navigate the user depending on its user type to its respective pages. Like Admin = Admin.jsp, Client= Client.jsp etc.
      Where all users will have their respective permissions to work in your system.

  2. pradeepkumarhe1989@gmail.com'

    i am getting Error-The request sent by the client was syntactically incorrect.

  3. jagritics22@gmail.com'

    why you added applicationcontext. xml in web.xml param name

  4. emailtotesahu@gmail.com'

    I just downloaded the “Spring MVC Login Form Example With Netbeans” example.In the project itself there was no pom.xml.But in your project structure I am seeing the pom.xml.Am i missing something here.
    Thank you for your help.

    • Hi Tejeswar,

      Thanks for following us. The example you have downloaded “Spring MVC Login Form Example With Netbeans” was written based on Ant build.

      For maven you can download the latest one “Spring MVC Login Form Example with STS (NEW)”. It is completely implemented in maven.

      Please don’t hesitate to write comment us, if you find any problem.

      Thanks.

  5. kanchan603@gmail.com'

    can u please give example first register then login and then CRUD operation in single project

  6. dssprakash@gmail.com'

    When i submit page i got ” WARN : org.springframework.web.servlet.PageNotFound – Request method ‘POST’ not supported ” this exception and it shows “HTTP Status 405 – Request method ‘POST’ not supported” error at main page.
    Please explain exception ..

  7. venkateshvc225@gmail.com'

    Hey i am not finding source file for root-context.xml…. can please send the code .. I am doing project in Maven

  8. surendrapandey3788@gmail.com'

    Very Well explained..

    Thank you @chandrashekhar

  9. obichinna1@gmail.com'

    I want login and registration example with spring +hibernate in with explanation… Your explaining way is very impressed me if possible please send fastly

  10. thiyagaaraaj@gmail.com'

    Hi,
    I am new to Spring. I understood the .files which is explained in above post.But I need what are the software requirements and how to add these files in a project. Please need an explanation in Eclipse.

  11. sheejacp@optiriskindia.com'

    I am getting an error HTTP status 405 “Request method ‘GET’ not supported”. Why i’m getting this?

  12. prasantamishra34@gmail.com'

    I am getting an error HTTP status 405 “Request method ‘GET’ not supported”

    can anyone explain why?

Leave a Reply

Your email address will not be published. Required fields are marked *