Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

In MVC

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In a architecture pattern like MVC, it is mandatory that Servlet should
be the controller, why not JSP?
 
Ranch Hand
Posts: 203
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Their are couple of reasons for using servlet and not jsp as controller component.

1) JSP should not include the java code which is the integral part in building the controller as you need to perfrom various checks on in coming request.

2) JSP is meant for the developers which need not have the java knoeledge

3) Your controller intracts with your model and hence not directly accessed from the browser which is not the case with the JSP
 
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I started to type up a response but the following article (almost 10 years old) does a better job:

http://www.javaworld.com/javaworld/jw-12-1999/jw-12-ssj-jspmvc.html

Nothing is "mandatory" but if you have ever worked on a project with 2000 line JSP files you will know how hard they are to develop, debug and maintain.

- Brent
 
Goodbye moon men. Hello tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic