понедельник, 3 декабря 2012 г.

Определение библиотек тегов типа *.tag не через tagdir, а через uri

web.xml
<?xml version="1.0"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
 version="2.4">
    ...
    <jsp-config>
        <taglib>
            <taglib-uri>http://myurl.com/mytags</taglib-uri>
            <taglib-location>/WEB-INF/tld/mytags.tld</taglib-location>
        </taglib>
    </jsp-config>
</web-app>

WEB-INF/tld/mytags.tld:
<?xml version="1.0" encoding="ISO-8859-1"?>

<taglib xmlns="http://java.sun.com/xml/ns/j2ee"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"
        version="2.0">

    <tlib-version>1.0</tlib-version>
    <short-name>mytags</short-name>
    <uri>http://playtech.com/gala-tags</uri>


    <tag-file>
        <name>registrationFormPasswordRow</name>
        <path>/WEB-INF/tags/registration/registrationFormPasswordRow.tag</path>
    </tag-file>

    <tag-file>
        <name>registrationFormRow</name>
        <path>/WEB-INF/tags/registration/registrationFormRow.tag</path>
    </tag-file>

    <tag-file>
        <name>validationResult</name>
        <path>/WEB-INF/tags/registration/validationResult.tag</path>
    </tag-file>

</taglib>

Комментариев нет:

Отправить комментарий