• Post Reply Bookmark Topic Watch Topic
  • New Topic

servlet is used as controller  RSS feed

 
rex tony
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
why servlet is used as controller ?not JSP?
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 37395
531
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A JSP is for display purposes. In MVC, it shouldn't have any logic at all. Let alone control logic.

The servlet is responsible for the control logic. In Struts, it uses the XML file to gain this logic. It then redirects to the actions for the app specific logic.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!