I'm reading the steps to build a web app skeleton:
http://maestric.com/doc/java/spring/setup#web_app_skeleton
And feel it's greatly different from other languages like PHP.
How is it开发者_Go百科 executed?
web.xml is a deployment descriptor. It does not actually work in a way, the server (servlet container) reads this file to know what your application's needs are (what filters to create, servlets, configuration params etc).
Consider CGI for a second. In a CGI you have code that is executed and outputs HTML. The equivalent of this in Java is a Servlet. You have Java code that includes HTML.
The JSP is a Servlet turned inside out. You have HTML that includes Java code. When "executing" a JSP, the server will in fact turn it inside out and transform it into a Servlet.
The servlet is then executed, not the JSP.
P.S. this is off course a simplistic description, a lot more is going on behind the scenes.
精彩评论