• 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
  • Liutauras Vilda
  • Bear Bibeault
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Frits Walraven
Bartenders:
  • Carey Brown
  • salvin francis
  • Claude Moore

JSP or servlet - how to decide  RSS feed

 
Ranch Hand
Posts: 212
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. How do I decide if I should use JSP or servlet in my project?
2. If JSP is internally converted to Servlet what is the use of JSP? Why not write code in servlet instead of writing in JSP?What is the need for internal conversion to servlet?
 
Saloon Keeper
Posts: 5393
143
Android Firefox Browser Mac OS X Safari Tomcat Server VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In practice, you would use both together. Servlets are the controller (C) in a [wikipedia]Model View Controller[wikipedia] (a.k.a. MVC) architecture, whereas JSPs are the view (V).

There should never be code in a JSP, only tags, such as those from JSTL, or custom made ones.
 
Master Rancher
Posts: 4021
47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You would know why JSPs exist if you had ever attempted to write any webapp that's anything but the simplest possible.
 
Marshal
Posts: 67256
170
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Read this article to understand why it's never servlets or JSP, but servlets and JSP.
 
Ruth Stout was famous for gardening naked. Just like this tiny ad:
Create Edit Print & Convert PDF Using Free API with Java
https://coderanch.com/wiki/703735/Create-Convert-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!