aspose file tools*
The moose likes JSP and the fly likes MVC example | wrox press ch06 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "MVC example | wrox press ch06 " Watch "MVC example | wrox press ch06 " New topic
Author

MVC example | wrox press ch06

Scott Hutchings
Greenhorn

Joined: Apr 27, 2003
Posts: 3
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
 
jQuery in Action, 2nd edition
 
subject: MVC example | wrox press ch06