• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What's the difference between servlet and jsp?

 
T'R Dai
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's the difference between servlet and jsp, who can tell me in simple words?
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Servlet is designed to do processing but not display, JSP designed to do display but not processing.
 
T'R Dai
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David O'Meara wrote:Servlet is designed to do processing but not display, JSP designed to do display but not processing.

thank you!
 
Colin Wang
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tianrong Dai wrote:What's the difference between servlet and jsp, who can tell me in simple words?

JSP will be translated into servlet.
 
T'R Dai
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
colin wang wrote:
Tianrong Dai wrote:What's the difference between servlet and jsp, who can tell me in simple words?

JSP will be translated into servlet.

your means that servlet can do everything what jsp can do?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65126
92
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
colin wang wrote:JSP will be translated into servlet.

That is an implementation detail that has no bearing on when JSPs should be used and when servlets should be used.

Tianrong Dai wrote:your means that servlet can do everything what jsp can do?

Not really. JSPs can use mechanisms such as the JSTL, EL, custom tags, tag files, and other mechanisms geared towards creating views. Mimicking these in a servlet would not only be difficult, but foolish.
 
T'R Dai
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:
colin wang wrote:JSP will be translated into servlet.

That is an implementation detail that has no bearing on when JSPs should be used and when servlets should be used.

Tianrong Dai wrote:your means that servlet can do everything what jsp can do?

Not really. JSPs can use mechanisms such as the JSTL, EL, custom tags, tag files, and other mechanisms geared towards creating views. Mimicking these in a servlet would not only be difficult, but foolish.


oh,i see,thank you very much.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic