Javatpoint Logo

what are the difference between jsp and servlet

By: piyali*** On: Sun Jul 21 07:31:45 EDT 2013     Question Reputation0 Answer Reputation2 Quiz Belt Series Points0  2Blank User
exact differences is not given..i think
i want difference with example..
plz reply
Up0Down

 
1) as MVC architecture is corcern...
Servlet is the Controller and JSP is the View...
2) HTML with in the java code.......servlet
Java code with in the HTML....jsp
Image Created0Down

By: [email protected] On: Sun Jul 21 08:32:44 EDT 2013 Question Reputation0 Answer Reputation0 Belt Series Points0 0User Image
Are You Satisfied :3Yes3No
 
A JSP is a special kind of Servlet that is edited in a HTML-like syntax and compiled into Servlet byte code by a web container

JSPs can contain complex Java code, however that has been considered a bad practice for the last 8 years or so, so JSPs will usually only contain

Think of JSP as a convenient HTML factory.

-----------------------------------------------------


1. JSP can be compiled into Java Servlets's.
2. It easier than in Java in the JSP code.
3. JSP and Java Servlets are usually used in combination today.
4. Servlets comparison, JSP run faster



Image Created0Down

By: [email protected] On: Mon Jul 22 02:50:38 EDT 2013 Question Reputation0 Answer Reputation392 Belt Series Points0 392User Image
Are You Satisfied :3Yes2No
 
thank you very much..Image Created0Down

By: [email protected] On: Mon Jul 22 05:23:17 EDT 2013 Question Reputation0 Answer Reputation2 Belt Series Points0 2User Image
Are You Satisfied :1Yes1No