Announcement Announcement Module
Collapse
No announcement yet.
spring.tld not loaded Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • spring.tld not loaded

    Dear all,

    I need some hints why spring.tld is not loaded and corresponding tags are not evaluated in my Servlet 2.4 / JSP 2.1 / MyFaces 1.2.8 / Facelets 1.1.14 / Spring MVC 3.0.4 / Spring Webflow Faces 2.0.4 environment.

    I have a facelet which starts like that:

    Code:
    <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <ui:composition xmlns="http://www.w3.org/1999/xhtml"
    	xmlns:ui="http://java.sun.com/jsf/facelets"
    	xmlns:h="http://java.sun.com/jsf/html"
    	xmlns:f="http://java.sun.com/jsf/core"
    	xmlns:c="http://java.sun.com/jstl/core"
    	xmlns:spring="http://www.springframework.org/tags"
    	>
    	<html>
    		<head>
    			<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
    		</head>
    		<body>
    			<spring:message code="key" text="alternative" />
    ...
    Once the corresponding view is rendered, I see that the <spring:message... tag remains unresolved in the HTML source code. Other tags like <c:if... work flawlessly. (For what it's worth, a corresponding messageSource is declared and even the message exists in the property file.)

    My understanding is that TLDs don't have to be explicitly included in the web.xml anymore with JSP 2.0+ (Reference). However, I still see explicit inclusions like here. What exactly is the right way?

    The JAR where the spring.tld is included (org.springframework.web.servlet-3.0.4.RELEASE.jar) is included in the WAR.

    I understand that more configuration files would be required to analyze the problem, but I'm asking for some pointers where to search, instead, since I have absolutely no clue where the TLDs are loaded and where I should look for possible errors. I have already enabled breakpoints on SAXException and ServletException but without any result.

    Maybe someone has a working example available online where I could have a look and search further?

    I'd appreciate any pointers from the community.

    Best,
    hd

  • #2
    Is this what it's suppose to look like or function..?


    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN" "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">

    <taglib>

    <tlib-version>1.1.2</tlib-version>

    <jsp-version>1.2</jsp-version>

    <short-name>Spring</short-name>

    <uri>http://www.springframework.org/tags</uri>

    <description>Spring Framework JSP Tag Library. Authors: Rod Johnson, Juergen Hoeller</description>


    <tag>

    <name>htmlEscape</name>
    <tag-class>org.springframework.web.servlet.tags.HtmlEsc apeTag</tag-class>
    <body-content>JSP</body-content>

    <description>
    Sets default HTML escape value for the current page.
    Overrides a "defaultHtmlEscape" context-param in web.xml, if any.
    </description>

    <attribute>
    <name>defaultHtmlEscape</name>
    <required>true</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>

    </tag>


    <tag>

    <name>escapeBody</name>
    <tag-class>org.springframework.web.servlet.tags.EscapeB odyTag</tag-class>
    <body-content>JSP</body-content>

    <description>
    Escapes its enclosed body content, applying HTML escaping and/or JavaScript escaping.
    The HTML escaping flag participates in a page-wide or application-wide setting
    (i.e. by HtmlEscapeTag or a "defaultHtmlEscape" context-param in web.xml).
    </description>

    <attribute>
    <name>htmlEscape</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>

    <attribute>
    <name>javaScriptEscape</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>

    </tag>


    <tag>

    <name>message</name>
    <tag-class>org.springframework.web.servlet.tags.Message Tag</tag-class>
    <body-content>JSP</body-content>

    <description>
    Retrieves the message with the given code, or text if code isn't resolvable.
    The HTML escaping flag participates in a page-wide or application-wide setting
    (i.e. by HtmlEscapeTag or a "defaultHtmlEscape" context-param in web.xml).
    </description>

    <attribute>
    <name>message</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>

    <attribute>
    <name>code</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>

    <attribute>
    <name>arguments</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>

    <attribute>
    <name>text</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>

    <attribute>
    <name>var</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>

    <attribute>
    <name>scope</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>

    <attribute>
    <name>htmlEscape</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>

    <attribute>
    <name>javaScriptEscape</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>

    </tag>


    <tag>

    <name>theme</name>
    <tag-class>org.springframework.web.servlet.tags.ThemeTa g</tag-class>
    <body-content>JSP</body-content>

    <description>
    Retrieves the theme message with the given code, or text if code isn't resolvable.
    The HTML escaping flag participates in a page-wide or application-wide setting
    (i.e. by HtmlEscapeTag or a "defaultHtmlEscape" context-param in web.xml).
    </description>

    <attribute>
    <name>code</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>

    <attribute>
    <name>arguments</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>

    <attribute>
    <name>text</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>

    <attribute>
    <name>var</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>

    <attribute>
    <name>scope</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>

    <attribute>
    <name>htmlEscape</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>

    <attribute>
    <name>javaScriptEscape</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>

    </tag>


    <tag>

    <name>hasBindErrors</name>
    <tag-class>org.springframework.web.servlet.tags.BindErr orsTag</tag-class>
    <body-content>JSP</body-content>

    <description>
    Provides Errors instance in case of bind errors.
    The HTML escaping flag participates in a page-wide or application-wide setting
    (i.e. by HtmlEscapeTag or a "defaultHtmlEscape" context-param in web.xml).
    </description>

    <variable>
    <name-given>errors</name-given>
    <variable-class>org.springframework.validation.Errors</variable-class>
    </variable>

    <attribute>
    <name>name</name>
    <required>true</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>

    <attribute>
    <name>htmlEscape</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>

    </tag>


    <tag>

    <name>nestedPath</name>
    <tag-class>org.springframework.web.servlet.tags.NestedP athTag</tag-class>
    <body-content>JSP</body-content>

    <description>
    Sets a nested path to be used by the bind tag's path.
    </description>

    <variable>
    <name-given>nestedPath</name-given>
    <variable-class>java.lang.String</variable-class>
    </variable>

    <attribute>
    <name>path</name>
    <required>true</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>

    </tag>


    <tag>

    <name>bind</name>
    <tag-class>org.springframework.web.servlet.tags.BindTag </tag-class>
    <body-content>JSP</body-content>

    <description>
    Provides BindStatus object for the given bind path.
    The HTML escaping flag participates in a page-wide or application-wide setting
    (i.e. by HtmlEscapeTag or a "defaultHtmlEscape" context-param in web.xml).
    </description>

    <variable>
    <name-given>status</name-given>
    <variable-class>org.springframework.web.servlet.support.Bind Status</variable-class>
    </variable>

    <attribute>
    <name>path</name>
    <required>true</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>

    <attribute>
    <name>ignoreNestedPath</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>

    <attribute>
    <name>htmlEscape</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>

    </tag>


    <tag>

    <name>transform</name>
    <tag-class>org.springframework.web.servlet.tags.Transfo rmTag</tag-class>
    <body-content>JSP</body-content>

    <description>
    Provides transformation of variables to Strings, using an appropriate
    custom PropertyEditor from BindTag (can only be used inside BindTag).
    The HTML escaping flag participates in a page-wide or application-wide setting
    (i.e. by HtmlEscapeTag or a "defaultHtmlEscape" context-param in web.xml).
    </description>

    <attribute>
    <name>value</name>
    <required>true</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>

    <attribute>
    <name>var</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>

    <attribute>
    <name>scope</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>

    <attribute>
    <name>htmlEscape</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>

    </tag>

    </taglib>

    Comment


    • #3
      That's the file I'm referring to but unfortunately pasting the file doesn't answer the question. I know how the file looks and I know in which JAR it's located, I was just wondering why it's not loaded/recognized.

      Thanks,
      hd

      Comment

      Working...
      X