java - 参照下面webapp的xml配置文件内容,请教一下url 与 uri 有 什么区别?
PHP中文网
PHP中文网 2017-04-17 17:47:45
0
2
712

<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中文网

认证高级PHP讲师

reply all(2)
迷茫

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.

左手右手慢动作

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.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template