Difference B/W JSP and Servlets
|
|
|
Question / Problem
|
What is the difference between JSP and Servlets?
|
Solution
|
1) Simple things are easier to done in JSP as servlets require more initialization. 2) With use of JSP there is no need to write lots of out.println("..") statements each time one want to send HTML to the browser. 3) JSP mix Code into HTML whereas Servlets mix HTML into code. 4) If there is lot of HTML output and less java code than JSP are simple. 5) If there is little HTNL output and more java code than Servlets are simpler. 6) Debugging JSP is difficult as code is translated to other form i.e Servet befor run.
|
Applies to |
|
JSP
|
Rank It |
|