If a JAR is placed on an application class class, as we refer to it from the JSP

In our application we get an error message:

PWC6117: File "/struts-tags" not found

in the file that gives the error:

<%@ taglib prefix="s" uri="/struts-tags" %>

This file is located in struts2-core.jar, which is placed in the application server class path (Sun 9.1).

The code will work fine and will not complain when the bank is actually in the WEB-INF / lib application, compared to what is on the way to the classes on the application server. But we cannot change that. this should be on the way to the classes of appservers.

But how should we change our code so that this error disappears?

I can create a mapping in my web.xml to change the uri. but what should the taglib location be changed? so does it reference an application class class?

<taglib>
<taglib-uri>/WEB-INF/struts-tags.tld</taglib-uri> 
<taglib-location>/WEB-INF/struts-tags.tld</taglib-location> 
</taglib>
+3
3

, - . , jar , . "" lib ( , WebSphere... Sun),

0

JSP , classpath, / librariy tld. , TLD. , classpath class, . tld; , .

JSP 2.2 JSP URI, taglib, :

  • URI TLD [URL] ( URL-, "/", - .. URL- webapp).

    , taglib, ( ):

    • A) Java EE ( JSP- JSF)
    • B) Taglib web.xml
    • C) TLD WEB-INF/lib/.jar, WEB-INF/.tld WEB-INF/*/. tld
    • D)
    • E) , , URI TLD.

    B) D) . D) , , taglib, /. SUN 9.1 doc, , D). , SUN 9.1 TLD JAR , B), Q.

  • TLD TLD. TLD :

    • TLD ,
    • JAR TLD META-INF/taglib.tld.

    TLD , .

    . , , <taglib-location> TLD, META-INF/taglib.tld JAR point <taglib-location> JAR.

0

, , TLD WEB-INF uri JSP taglib. , classpath.

JSP 2.0

TLD

  • /WEB-INF/MyTags.tld
  • /WEB-INF/Any-Sub-Dir/MyTags.tld
  • /WEB-INF/lib/tag-lib.jar /META -INF/MyTags.tld
  • /WEB-INF/lib/tag-lib.jar /META -INF/Any-Sub-Dir/MyTags.tld

- JSP 2.0, - <taglib>, web.xml. , <taglib-location> - . , .tld /WEB-INF.

. classpath. ( tld) (, struts2-core.jar) WEB-INF/lib.

: WEB-INF/classes; - WEB-INF/lib . , , , :

  • /META-INF/struts-tags.tld struts2-core.jar
  • struts-tags.tld /WEB-INF (/tlds /struts ..)
  • <taglib> ( , JSP 2.0)

, tld. /META-INF/struts-tags.tld struts2-core-tags.jar /WEB-INF/lib.

0

Source: https://habr.com/ru/post/1721229/


All Articles