Differences and relations between servlet and jsp technology

------------ ------------ restore content begins

the difference

1.jsp translated, it becomes a Servlet. (Essence JSP is Servlet, JVM only identify java classes, JSP does not recognize the code, Web container JSP code will be compiled into JVM java class can be identified)

2.jsp better at showing content, servlet better at logic control, business processes.

3.Servlet no built-in objects, Jsp in the built-in objects are necessary, HttpServletResponse HttpServlet objects, and objects obtained by HttpServletRequest object.

Servlet and JSP main difference that the application logic is a Java Servlet file, and completely separated from the HTML presentation layer. The situation JSP is Java and HTML can be combined into a .jsp file extension. JSP focuses on view, Servlet mainly used to control logic, the service processing

 

Jsp is a simplified package after the Servlet, Jsp use only need to complete the customer needs to output the contents of the client browser to show how Jsp the Java script embedded in a class, done by Jsp container. The Servlet is a complete Java classes, Service method of this class is used to generate a response to the client browser.

Contact: JSP Servlet technology is an extension of the simple way is essentially the Servlet. After the JSP translation is "servlet".

End ------------ ------------ restore content

Guess you like

Origin www.cnblogs.com/4756yaoyexingjun/p/11832422.html