Announcement Announcement Module
Collapse
No announcement yet.
fn:contains function error Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • fn:contains function error

    Hello

    In my jsp file, I have simple code:
    ======================

    <c:if test="${fn:contains('aaba', 'b')}">checked</c:if>

    However, there is error:

    SEVERE: Could not complete request
    org.apache.jasper.JasperException: <h3>Validation error messages from TagLibraryValidator for c</h3><p>409: tag = 'if' / attribute = 'test': An error occurred while parsing custom action attribute "test" with value "${fn:contains('aaa', 'b')}": org.apache.taglibs.standard.lang.jstl.parser.Parse Exception: EL functions are not supported.</p>
    at org.apache.jasper.compiler.DefaultErrorHandler.jsp Error(DefaultErrorHandler.java:50)

    I think that this is very simple but there is aN error
    Could you please help.

    Of cours, I have jstl/core and fn.tld in this page

    Many thanks
    sho

  • #2
    Which version of JSP are you using?

    With JSP 2.0/JSTL 1.1 you need to import the following taglibs:

    Code:
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
    For JSP 2.0 also make sure that your web application is declared correctly in the web.xml:

    Code:
    <web-app id="mvcrap" version="2.4" 
             xmlns="http://java.sun.com/xml/ns/j2ee" 
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
             xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    
    ...
    
    </web-app>
    I not sure if jstl 1.0 already supported functions...

    /christof

    Comment

    Working...
    X