• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Controller servlet gets messy

 
Derek Bright
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, i have a controller servlet but it seems to get too messy as my project is rather huge. Is there a way to simplify my controller servlet, say like creating another controller from the main controller servlet, OR there are better ways? Thanks~
 
Sudarshan Chakrabarty
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why don't you try out Struts ?
 
arulk pillai
Author
Ranch Hand
Posts: 3387
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you using a front-controller pattern? You seem to be having a separate servlet for each type of request? You can try and use composition (preferred) or inheritance to separate out reusable comon logic.
 
Gopikrishna Kunisetty
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Derek Bright,
Can you add more details about your problem?
 
Derek Bright
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hmm... i try to summarize

under my web.war i have a servlet controller which directs the request to the respective jsp. To make things less complicated in the controller, i have create separate java class (act as managers) to communicate with the session beans. The controller would only need to call the java class manager. However, i still find the codes in controller rather long. So how can i solve this?

overview:
controller -> manager -> session beans
then controller dispatches the necessary jsp file.

Hopefully you get what i am trying to say...
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64720
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please read this article, and if interested, check out my Front Man controller implementation.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic