• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

MVC example | wrox press ch06

 
Scott Hutchings
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Like many people, I'm working through sample code in Wrox Press JSP 2nd edition. I'm currently working on the "Time Entry" MVC example from Chapter 6.
I'm trying to enable Authentication and maintain the MVC approach. Part of my confusion is the authors included source code (such as LoginFailedEventHandler.java) that is not used in the application.
The problem: What approach can be used to implement authentication with this application? My idea is you would give the user a choice at the index page to login or register. (Let's assume I've developed an AuthenticateHandler class and updated the correct property files)
-The user chooses to login and is presented with a form on the login.jsp page and prompted for username and password.
-Upon submitting the form, the event is set to "AUTHENTICATE" and passed to the controller servlet.
-The controller servlet identifies the event and calls the process method of the AuthenticateHandler class. The process method contains the business logic and will verify or deny a user. How should an incorrect login be handled? Should it throw an Error, change the event, or change the URL it will forward to?
I've noticed the Struts example in Chapter 21 is quite robust, however, I need a solid understanding of this example before I move on.
Thanks
Scott Hutchings
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic