English 中文(简体)
JSPX namespaces not visible for EL functions?
原标题:

I m attempting to use JSPX (pure XML syntax for JSP) and running into what seems like it should work, but doesn t. I m importing taglibs using namespace declarations in the jsp:root element, then using these later on for elements as well as EL functions:

<jsp:root version="2.0"
    xmlns:jsp="http://java.sun.com/JSP/
    xmlns:c="urn:jsptld:/WEB-INF/tld/c.tld"
    xmlns:fn="urn:jsptld:/WEB-INF/tld/fn.tld">
    ...
    <c:if test="${fn:length(list) &gt; 0">
        ...
    </c:if>
    ...
</jsp:root>

I get an exception saying "The attribute prefix fn does not correspond to any imported tag library". Other pages work fine, but this page differs in that it uses a few EL functions contained in a tag library.

Is there a different kind of import I need that will bring these taglib prefixes into a scope that s visible for EL function calls?

最佳回答

Why don t you use the full TLD URI? You can find here an overview of the valid JSTL TLD URI s (click at any JSTL taglib of your interest to get the valid declaration examples).

To be sure: you have placed the JSTL JAR file(s) (jstl.jar and/or standard.jar, depending on JSTL version, until with 1.1 it s both and in 1.2 it s only jstl.jar) in the classpath and you did not extract them nor cluttered the classpath and/or web.xml with loose files and declarations as some poor online tutorials say?

问题回答

暂无回答




相关问题
how to represent it in dtd?

I have two element action and guid. guid is a required field when action is add. but when action is del it will not appear in file. How to represent this in dtd ?

.Net application configuration add xml-data

I need to add xml-content to my application configuration file. Is there a way to add it directly to the appSettings section or do I need to implement a configSection? Is it possible to add the xml ...

XStream serializing collections

I have a class structure that I would like to serialize with Xstream. The root class contains a collection of other objects (of varying types). I would like to only serialize part of the objects that ...

MS Word splits words in its XML format

I have a Word 2003 document saved as a XML in WordProcessingML format. It contains few placeholders which will be dynamically replaced by an appropriate content. But, the problem is that Word ...

Merging an XML file with a list of changes

I have two XML files that are generated by another application I have no control over. The first is a settings file, and the second is a list of changes that should be applied to the first. Main ...

How do I check if a node has no siblings?

I have a org.w3c.dom.Node object. I would like to see if it has any other siblings. Here s what I have tried: Node sibling = node.getNextSibling(); if(sibling == null) return true; else ...

Ordering a hash to xml: Rails

I m building an xml document from a hash. The xml attributes need to be in order. How can this be accomplished? hash.to_xml

热门标签