Servlet JSP web.xml

后端 未结 3 1611
不思量自难忘°
不思量自难忘° 2021-01-01 23:27

I see a feature in NetBeans for selecting a JSP for a Servlet and the result XML in web.xml is like this:



        
3条回答
  •  天命终不由人
    2021-01-01 23:51

    JSPs are servlets. JSP is a templating technology that parses the .jsp file and generates a servlet .java file. Once that's done, the .java file is compiled into a .class file that runs in the servlet/JSP engine context.

    All the web.xml file is doing is associating a .jsp file with a servlet name. There's more: you have to map that .jsp to a URL so the servlet/JSP engine can know when to invoke it.

    I don't know ASP or .NET well enough to say whether this is the same as "code behind".

提交回复
热议问题