UNIT - 5 Difference Between Servlet and JSP
UNIT - 5 Difference Between Servlet and JSP
SERVLET JSP
written purely on Java. way, we can say that JSPs are extension of servlets
Servlets run faster than JSP JSP runs slower because it has the transition phase
compilation
Executes inside a Web server, such as A JSP program is compiled into a Java servlet
Receives HTTP requests from users and Easier to write than servlets as it is similar to
We can not build any custom tags One of the key advantage is we can build custom
flexibility
SERVLET JSP
Servlet has the life cycle methods init(), JSP has the life cycle methods of jspInit(),
Written in Java, with a few additional JSPs can make use of the Javabeans inside the web
techniques.
controller.
2. Simplicity : Run inside controlled 4. Parsing and decoding HTML form data.
server environment. No specific client 5. JSP is Efficient: Every request for a JSP is
integration