Results 1 to 5 of 5

Thread: Is the spring.tld uri accessible via the web?

  1. #1
    Join Date
    Oct 2004
    Location
    Raleigh, NC
    Posts
    3

    Default Is the spring.tld uri accessible via the web?

    Is the spring.tld uri accessible via the web?

    To clarify can I specify the taglib location like I can with JSTL:
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
    or
    do I need to maintain a local copy, as i see in all examples I've found.

    Thanks

  2. #2
    Join Date
    Aug 2004
    Location
    Athens, GA
    Posts
    20

    Default

    from spring.tld:

    Code:
    <uri>http&#58;//www.springframework.org/tags</uri>
    So if you have < 2.4 contrainer all u need is

    Code:
    <%@ taglib prefix="spring" uri="http&#58;//www.springframework.org/tags" %>
    As long you have the spring.jar in lib

  3. #3
    Join Date
    Aug 2004
    Location
    Carlisle, UK
    Posts
    184

    Default

    I am using jboss 3.2.5/tomcat 5.0.?, which is servlet 2.4

    However spring.jar is not in WEB-INF/lib.
    I am deploying my app as an ear, with spring.jar as a jar in the top level ear directory.

    In this case the code above doesn't work, and I need a local copy of spring.tld in WEB-INF.
    Is this because of the location of spring.jar?
    If so, is there any way to get it to work with spring.jar in a different location?
    Chris Harris
    Carlisle, UK

  4. #4
    Join Date
    Aug 2004
    Location
    Melbourne, Australia
    Posts
    1,104

    Default

    Is this because of the location of spring.jar?
    Yes. The TLD can be found implicitly in the META-INF directory of JARs in WEB-INF/lib (you can make it explicit as shown below - relative to WEB-INF):
    Code:
    <taglib>
      <taglib-uri>/springframework</taglib-uri>
      <taglib-location>lib/spring.jar</taglib-location>
    </taglib>
    is there any way to get it to work with spring.jar in a different location?
    Yes. Copy spring.tld into /WEB-INF/tlds. It should be found implicitly, but you can make it explicit by adding the following to the web.xml.
    Code:
    <taglib>
        <taglib-uri>/springframework</taglib-uri>
        <taglib-location>/WEB-INF/tlds/spring.tld</taglib-location>
    </taglib>
    then it can be used as:
    Code:
    <%@ taglib uri=”/springframework” prefix=”spring” %>
    There is a fallback rule with 2.4 that is less flexible, so you could use:
    Code:
    <%@ taglib uri=”/WEB-INF/tlds/spring.tld” prefix=”spring” %>

  5. #5
    Join Date
    Aug 2004
    Location
    Carlisle, UK
    Posts
    184

    Default

    So, if I'm understanding correctly, if spring.jar is outside my webapp's war, or to be more specific, outside WEB-INF, then I must have a copy of the tld file somewhere within the WEB-INF directory structure.

    Thanks for your help,
    Chris Harris
    Carlisle, UK

Similar Threads

  1. making services accessible from multiple webapps
    By novotny in forum Container
    Replies: 9
    Last Post: Feb 16th, 2006, 03:52 PM
  2. Replies: 3
    Last Post: Nov 12th, 2005, 02:29 PM
  3. Replies: 1
    Last Post: Jun 23rd, 2005, 01:17 PM
  4. Replies: 1
    Last Post: Mar 11th, 2005, 10:39 PM
  5. Error in spring.tld
    By mdavidn in forum Web
    Replies: 2
    Last Post: Nov 16th, 2004, 12:50 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •