This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes servlet is used as controller Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "servlet is used as controller " Watch "servlet is used as controller " New topic
Author

servlet is used as controller

rex tony
Ranch Hand

Joined: Aug 29, 2007
Posts: 159
why servlet is used as controller ?not JSP?
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30076
    
149

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.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
Consider Paul's rocket mass heater.
 
subject: servlet is used as controller
 
Similar Threads
Can Jsp dispatch request as Servlets
MVC
InstanceAlreadyExists Exception
Connection Object pointing to Null
controller responsibility