• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Handling different user types using MVC pattern

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
You learn how to close your eyes and tell yourself "this just isn't really happening to me." Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic