Meaningless Drivel is fun!*
The moose likes OO, Patterns, UML and Refactoring and the fly likes Handling different user types using MVC pattern Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "Handling different user types using MVC pattern" Watch "Handling different user types using MVC pattern" New topic
Author

Handling different user types using MVC pattern

Harish Moolchandani
Greenhorn

Joined: Mar 12, 2010
Posts: 23
I've to make view and controller for registering different types of users
CONSUMER, EMPLOYER and ADMIN

How to implement it using MVC pattern in java?
Currently I did it like this,

RegisterAs.tag (A tag, user selects the user type and press register button. It passes USERTYPE in the query string).
RegisterUserFormController.java (Sets the bean objects required by form, such as "Skills" bean object).
RegisterUser.jsp (The form for registration according to the selected usertype).
RegisterUserController.java (Checks the usertype, creates appropriate model and passes it to insertUser method).
DisplayMessage.jsp (Shows a message whether registration is successful or not).

Also, should I make different registration forms for different users? such as RegisterConsumer.jsp, RegisterEmployer.jsp, etc and then there will be different controllers for each of them. I didn't do it like this because each of them has almost similar functionality.

And I had EditUser functionality similar to this.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Handling different user types using MVC pattern