What are JSTL mandatory Jars

前端 未结 1 1383
伪装坚强ぢ
伪装坚强ぢ 2021-01-24 12:26

I am new, and just start learning Java. From the jstl tag, I know a lot about jstl.

I use IDE(eclispe mars) to create a dynamic web project by adding a simple jsp page,

相关标签:
1条回答
  • 2021-01-24 12:46

    I think about the qestion over the night, and I realize that maybe the answer is just beside the jar. The last part of the question, about the 4 apache tomcat jars, From the link, there are 2 readme text files(Source README, Binary README)

    It says:

    There are three primary sub-modules:
    
        spec            <-- contains Apache's implementation of the API classes
        impl            <-- contains the implementation of tags from the 1.1
                            namespace http://java.sun.com/jsp/jstl/*
        jstlel          <-- contains the implementation of tags from the 1.0
                            namespace http://java.sun.com/jstl/* and uses the
                            original JSTL 1.0 version of EL
    
    In addition, the following modules provide supporting functionality
        build-tools     <-- build support such as checkstyle rules
        compat          <-- contains the implementation of tags from the 1.0
                            namespace but uses the JSP container's implementation
                            of EL (which will be 2.1 or later).
    

    Binary README:

    This version of the Standard Tag Library has the following runtime
    dependencies:
    
       1. Dependencies provided by a JSP 2.1 container:
          - Java 1.5 or later
          - Servlet 2.5 or later
          - JSP 2.1 or later
    
       2. Additional dependencies
          - The XML tag library requires Apache Xalan 2.7.1 or later
    
    ---
    Apache Xalan 2.7.1
    
    To address performance issues with XSLT processing, this version relies on
    implementation specific functionality from Apache Xalan. The following
    libraries should be included in the classpath for your application:
       - xalan-2.7.1.jar
       - serializer-2.7.1.jar
    
    ---------------------------------------------------------------------------
    ADD DEPENDENCIES TO A WEB APPLICATION
    
    To use this distribution with your own web applications, add the following JAR
    files to the '/WEB-INF/lib' directory of your application:
       - taglibs-standard-spec-1.2.5.jar
       - taglibs-standard-impl-1.2.5.jar
       - taglibs-standard-jstlel-1.2.5.jar
       - xalan-2.7.1.jar
       - serializer-2.7.1.jar
    
    If you do not use JSTL 1.0 tags then the "taglibs-standard-jstlel" JAR may be
    omitted. If you do not use the XML library, then the Apache Xalan dependencies
    may also be omitted.
    
    If you build you application with Maven, add the following dependencies to
    your pom.xml file:
    
        <dependency>
          <groupId>org.apache.taglibs</groupId>
          <artifactId>taglibs-standard-spec</artifactId>
          <version>1.2.5</version>
        </dependency>
        <dependency>
          <groupId>org.apache.taglibs</groupId>
          <artifactId>taglibs-standard-impl</artifactId>
          <version>1.2.5</version>
        </dependency>
    

    I also use jd-gui to decompile the jars, then I find some classes in taglibs-standard-impl-1.2.5.jar, their base classes are in taglibs-standard-spec-1.2.5.jar.

    Also use the decompiling methodology, I can find that,

    jstl-1.2.jar is a single jar, but it has two main packages in the jar. - 1) org.apache.taglibs.standard - 2) javax.servlet.jsp.jstl

    javax.servlet.jsp.jstl-1.2.4.jar and javax.servlet.jsp.jstl-api-1.2.1.jar is another group jar.

    each of them has only one main package in each jar, they are org.apache.taglibs.standard namespace in javax.servlet.jsp.jstl-1.2.4.jar, and javax.servlet.jsp.jstl namesapce in javax.servlet.jsp.jstl-api-1.2.1.jar. So we can say the combination of the two jars is equal to the jstl.jar

    The situation is similar to the apache tomcat jars group. The difference is that the apache tomcat implementation divide more classes into 3 or 4 different jar files.

    So as of now, I can say I understand most of the basic usages of those apache tomcat jars.

    0 讨论(0)
提交回复
热议问题