简体   繁体   中英

Java jsp taglib

I frequently saw links to "external tag libraries" in jsp Ex:

<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>

But I couldn't find answers to these questions:

  • Does use a tag library from an external web location?
    • Does it query that location every time the tag is used?
    • Does it download it only once?
      • when does the download happen?
  • Can I create my own tag library, and provide a similar external link to others?

Please edit this question if it's wrong, I never really asked questions of this type

A tag library is part of the application, no download is happening at runtime. The URL you see on the JSP page is just a namespace URI to bind the prefix used on the page to the tag library.

Yes, you can create your own tag library.

Please refer bold replies

  • Does use a tag library from an external web location? No
    • Does it query that location every time the tag is used? No
    • Does it download it only once? No download so no query
      • when does the download happen? Download never happens
  • Can I create my own tag library, and provide a similar external link to others? Yes

The uri you see the JSP page, is actually referenced from web.xml file, refer to jsp-config .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM