Bookmark Topic Watch 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:
  • Devaka Cooray
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • paul wheaton
  • Paul Clapham
Saloon Keepers:
  • Piet Souris
Bartenders:
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Even though JSPs are based upon Servlet technology, that does not mean that they are interchangable. It also doesn't mean that they are competing technologies.

Rather, both of JSPs and Servlets have their place in a well-structured web application.

So the question never is really "JSP or Servlets", because the answer is "JSP and Servlets".

In a properly structured web application servlets will be used for control (the 'C' part of MVC) and JSPs to render the views (the 'V' part).

For more information, search for the terms MVC and "Model 2" with respect to web applications. Also, this Javaranch Journal article explains the evolution of modern best practices with regards to web application structure.

Also note that there are some things JSPs can't do, e.g. generate (or stream) binary content. For those, servlets must be used.


JspFaq
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic