Home  >  Q&A  >  body text

java - 参照下面webapp的xml配置文件内容,请教一下url 与 uri 有 什么区别?

<servlet-mapping>中的为什么用<url-pattern> ,而 <taglib>中,使用<taglib-uri>

<web-app>

  <servlet>
    <servlet-name>dispatcher</servlet-name>
    <servlet-class>mypack.DispatcherServlet</servlet-class>
  </servlet>

  <servlet-mapping>
    <servlet-name>dispatcher</servlet-name>
    <url-pattern>/dispatcher</url-pattern>
  </servlet-mapping>

  <taglib>
    <taglib-uri>/mytaglib</taglib-uri>
    <taglib-location>/WEB-INF/mytaglib.tld</taglib-location>
  </taglib>

</web-app>
PHP中文网PHP中文网2741 days ago676

reply all(2)I'll reply

  • 迷茫

    迷茫2017-04-17 17:49:45

    What is a URI? Every resource available on the Web - HTML documents, images, video clips, programs, etc. - is located by a Universal Resource Identifier (URI).

    What is URL:

    URL is the abbreviation of Uniform Resource Location, translated as "Uniform Resource Locator". In layman's terms, URL is a string used to describe information resources on the Internet, and is mainly used in various WWW client programs and server programs. URLs can be used to describe various information resources in a unified format, including files, server addresses and directories, etc.


    The difference is that URI defines a resource, while URL not only defines the resource, but also defines how to find the resource. For example, on a server, the absolute path to a folder/webpage is the URI.

    I feel like the person above said the opposite.

    reply
    0
  • ringa_lee

    ringa_lee2017-04-17 17:49:45

    URL is a specific URI that not only uniquely identifies a resource, but also provides information to locate the resource. URI is a semantic abstract concept that can be absolute or relative, while URL must provide enough information for positioning, so it is absolute, while the usually relative URL is for another Absolute URL is still absolute in nature.

    reply
    0
  • Cancelreply