Servlet JSP web.xml

后端 未结 3 1620
不思量自难忘°
不思量自难忘° 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:53

    JSPs are kind of servlet. JSP pages are compiled into servlet. This servlet run in the servlet container provided by any java web server.

    In web.xml, tag used to name the name servlet class and jsp file. Then you can map those servlet and jsp file according to your own URLs.

    
       hello
       /jsp/hello.jsp
    
    
      hello
      /helloworld
    
    

    If your hello.jsp file located under JSP folder. When you try to open the URL with /helloworld. It will open the page hello.jsp.

提交回复
热议问题