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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis
  • Mark post as helpful
  • send pies
  • 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
 
machines help you to do more, but experience less. Experience this tiny ad:
ScroogeXHTML - small and flexible RTF to HTML converter library
https://coderanch.com/t/710903/ScroogeXHTML-RTF-HTML-XHTML-converter
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!