JSTL 's function tag

I have tried to use function tag in my jsp page. However, I kept receiving this error message:
<h3>Validation error messages from TagLibraryValidator for c</h3><p>35: tag = 'out' / attribute = 'value': An error occurred while parsing custom action attribute "value" with value "${fn:toUpperCase(who)}": org.apache.taglibs.standard.lang.jstl.parser.ParseException: EL functions are not supported.</p>
It seems that I got some configuration problem with function tag, but can't find out what it exactly is. The core, xml, sql, fmt tags all could run properly, I really can't understand what is wrong with function. I am using jstl 1.1 and located in the lib folder. I addressed
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
on the top of the page.
Please help me out. Many thanks

It dosen't work with out c:out. I found that I got
different error messages if I address
uri= "http://java.sun.com/jsp/jstl/functions" and
"http://java.sun.com/jstl/functions" (no /jsp)
Use the one with /jsp if you are using JSTL 1.1
Use the ont without /jsp if you are using JSTL1.0
>
the second one shows
The absolute uri: http://java.sun.com/jstl/functions
cannot be resolved in either web.xml or the jar files
deployed with this applicationProbably means you have JSTL 1.1
I have already put the fn.tld file in the WEB-INF
folder and mapped it in the web.xml. Take it out! All you need to do for JSTL 1.1 is put the standard.jar and jstl.jar into the WEB-INF/libs directory. No web.xml changes, no .tld placement, all that is handled in the JARS you put in the /lib directory.
The IDE I am
using is netBean 3.6. Anything else I missed? Please
help me out. Thanks

Similar Messages

  • JSTL escapeXml() function not working. . .

    Hi all,
    I have a problem trying to use the function �escapeXml()� from the functions tag library, my code is below. I have added JSTL1.1, both standard.jar and jstl.jar, to my project. I have placed the fn.tld in the WEB-INF directory and web.xml contains corresponding entries. Everything compiles etc.
    I am using JBuilder 2005; JDK 1.4.2, Tomcat 5.0 (Servlet 2.4 + JSP 2.0), Java 2 DSK v1.2 & later.
    When I web run the project it�s like the servlet container is not processing this function and it is returned to the browser as regular text, i.e. �${fn:escapeXml(product.productName)}�
    Maybe it is something silly that I�m doing (or not doing) but I would really appreciate some help if possible.
    Thanks in advance!
    Graham
    <%@ page errorPage="list_error.jsp" %>
    <%@ page language="java" contentType="text/html" %>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
    <html>
    <head>
    <title>list</title>
    </head>
    <body bgcolor="#ffffff">
    <h1>Product List</h1>
    <jsp:useBean id="list" class="htunes.ProductListBean" scope="request" />
    <p>
    <table border=0>
    <c:forEach items="${list.productList}" var="product">
    <tr>
    <td>${fn:escapeXml(product.productName)}</td>
    </tr>
    </c:forEach>
    </table>
    </p>
    </body>
    </html>

    Sorry for not formatting the code. Here goes!
    <%@ page errorPage="list_error.jsp" %>
    <%@ page language="java" contentType="text/html" %>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
    <html>
    <head>
    <title>list</title>
    </head>
    <body bgcolor="#ffffff">
    <h1>Product List</h1>
    <jsp:useBean id="list" class="htunes.ProductListBean" scope="request" />
    <p>
      <table border=0>
        <c:forEach items="${list.productList}" var="product">
          <tr>
            <td>${fn:escapeXml(product.productName)}</td>
          </tr>
        </c:forEach>
      </table>
    </p>
    </body>
    </html>

  • Issue with JSTL ( c:import ) tags in Weblogic 9.2

    Hi,
    I'm trying to migrate a struts (1.2.9) application from Weblogic 8.1 to Weblogic 9.2. This application has JSPs with JSTL (1.0) tags.
    I have a JSP page that has multiple (around 7) c:import statements. When I launch my application, only the content from the last c:import statement is being displayed and rest of the c:import tags statements is simply ignored by Weblogic.
    I don't find any errors in the logs. When I comment out last c:import statement in this JSP then the content from the above c:import statement is being displayed. Only one (last one) c:import statement's content is being displayed in that whole page.
    This app worked just fine Weblogic 8.1.
    Any resolutions, hints, insights or workarounds on this issue is appreciated.
    Thanks in advance,
    Mani
    Edited by: mayyalas on Aug 10, 2009 6:13 PM

    Hello,
    You should not need to edit the wlp-light-web-lib.war weblogic.xml file. There are many places where other classes in wlp-light-web-lib are dynamically loading classes (using Class.forName()) from "higher-level" shared library modules (such as wlp-framework-full-web-lib), so I am certain that it works in general. There may just be an issue with how your shared library is set up, or how your webapp deployment descriptors are set up.
    So you mention that you have a shared library module containing your implementation of the AnalyticEventHandler; is this a .war file? And in the webapp you are trying to deploy this in, does your weblogic.xml explicitly include your shared library? If so, is your shared library being included before or after the standard WLP shared libraries?
    If you would like, posting your webapp's weblogic.xml may help to find the problem.
    Kevin

  • Getting img tags to work in sub page using jstl core import tag

    Am trying to bring disparate system page reports together under one web app. This means using the jstl core import tag (I dont want to redirect as I want to hide the urls, this web app provides better security than those it calls).
    Use of the import tag works to a degree but any resources (ie. img tags) don't load.
    Have created a much simplified example that demonstrates..
    So heres the jsp...
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
    <h3>Delivery Performance Report</h3>
    <c:url value="http://localhost/mycontext/subpage.html" var="myUrl"/>
    <c:import url="${myUrl}" />and a simple sub page (note plain html, no jsp, this mimics my project as the other systems are hidden source, non jsp)
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
    <HTML>
    <HEAD>
    <TITLE>sub page</TITLE>
    </HEAD>
    <BODY>
         This is the sub page<br>
         <img src="images/banner_image.jpg" />
    </BODY>
    </HTML>While I dont get any errors what I do get is ..
    Delivery Performance Report
    This is the sub page
    ...but image fails to load.
    If I redirect instead of import it works, but as I said I need to hide the url from the user as security is an issue.
    Any help appreciated, really pulling my hair out with this final stage of something that will make a real difference to us!
    regards,
    G.

    Thanks for the answer but Im afraid thicko here doesnt get it.
    The img src is relative to the sub page, and I have tried it with an absolute address (ie. http://localhost/.....) with the same result.
    If I call the sub page direct (get with browser) the image tag works. Its just if the sub page is imported with the jstl core import tag.
    I've not tried a base tag. The real project always returns pages containing absolute urls... http://ourReportServer/reports?....plenty of params so dont belive relevant, please correct me if Im wrong here though.
    thanks, G.

  • Tray Function Tags

    Hi,
    Is it possible to create custom Tray Function Tags? I would like to add custom functions to the Iview Tray and turn those functions on or off in the Iview properties.
    Thanks,
    Raymond

    I have read something about creating a custom tray with 'containerWithTrayDesign'. How I see it this creates a custom tray but I still have to use the Tray Function Tags from the TagLibLayout.
    I this correct?
    YES, this is correct.
    Why am I not allowed to develop my own custom TagLibLayout or is it possible the modify/enhance the standard one?
    You can have your own tags to show some options in the tray, but this again needs, modification of IView, as the option to set them visible/invisible should be set there.
    Regards,
    Praveen Gudapati

  • JSTL c:import tag exception on WAS 6.20

    Hi all,
    has anyone been able to use the c:import jstl 1.0 tag on WAS 6.20?
    Everytime we access it it throws the following error:
    Exception occurs while processing a request to the servlet: jsp.
    javax.servlet.jsp.JspTagException: Since tag handler class org.apache.taglibs.standard.tag.el.core.ImportTag implements BodyTag, it can't return Tag.EVAL_BODY_INCLUDE
    Most, if not all, other tags seem to work fine, just this one doesn't. The same testpage and jstl version works fine on other non-SAP J2EE engines we have tested it on.
    Best Regards,
    Kalle Pokkinen

    Hi,
    This answer is mostly for reference - see OSS 0371142 2004 "JSP Standard 1.2 versus 1.1" for details.
    Best regards,
    Todor

  • Confused - I include library jstl 1.1 Tags but only jstl1.0 tags displayed

    I include library jstl 1.1 Tags in my project.
    Under project properties and jsp tag libraries there are no jstl1.1 tag libraries for me to include but only 1.0 versions?
    Am I misunderstanding something?

    Jdeveloper version 10.1.3.0.4
    For my project I have included libraries JSTL 1.1. and JSTL 1.1 Tags
    If I go to manage libraries under the JSP Tag libraries tab and deselect all JSTL 1.0 versions (checkbox "Show Tag Library in Palette") then these tag libraries disapear from the component pallete as expected.
    However if I select all the JSTL 1.1 versions they do not appear in the componette palette.
    Anyone have any ideas why this is so?

  • CF 10 CFML function, tag definitions and help files in DW cs6

    I'm unable to view the new CF 10 CFML function, tag definitions and help files in DW CS6 after using the ColdFusion10_Tags_for_DW.mxp update file. I see that the 'CF10 Extensions' are enabled in Adobe Extension Manager CS6.
    When I pull up the Reference tab Book: 'Adobe CF Function Reference', I don't see canonicalize in the drop down of 'CFFunctions'.
    Is there an issue with updating the extensions within DW CS6?
    Any help would be great.
    Garth

    I am afraid http://forums.adobe.com/community/coldfusion is more suitable for this question.

  • Jstl function tags question

    I'm trying to output the size of a Vector in jstl 1.1 like
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@ taglib uri="/tags/struts-html" prefix="html" %>
    <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
    <%@ include  file="header.jsp"%>
    <!-- ### -->
    <c:out value="${fn:length(aliasesInfo.aliases)}" />but when I run my app I get tomcat errors
    org.apache.jasper.JasperException: <h3>Validation error messages from TagLibraryValidator for c in /jsp/aliases/confirmAliases.jsp</h3><p>87: tag = 'out' / attribute = 'value': An error occurred while parsing custom action attribute "value" with value "${fn:length(aliasesInfo.aliases)}": org.apache.taglibs.standard.lang.jstl.parser.ParseException: EL functions are not supported.</p>Am I declaring the taglib correctly for the fn prefix?

    Hi ,
    i am uday
    i am very new to JSLT, i have no idea about it..
    i have been alloted a poject on JSLT ..the details of which will be getting on monday ...
    can you please help me in this regard ..where can i get materail or good information regarding JSLT..how it works ..
    Thanx in advance
    Uday

  • Question regarding JSTL and function calls

    Hello
    I'm quite new to JSTL and I'm having a problem accessing a function when I want to pass argument to that function.
    Im using MVC where my M (model.jsp) can be accest from my V (view.jsp) by doing ${model.(parameter/some function) }
    in my M I have a couple of getMethods() (example: getThisInfo() ) and som control methods like "isSomethingValid(arg1)"
    my question is lets say I want to access my "isSomethingValid(arg1)" and arg1 should be the value of "getThisInfo()" I thought I could do like
    ${model.somethingValid($model.thisInfo)} but it isnt working I get:
    "Unable to parse EL function ${model.somethingValid(model.thisInfo)}"
    I know that the syntax above is a mix of scriptlet and JSTL but I dont know how to or if its even possible to achieve this?
    Thanks for helping me!
    Best Regards/DS

    By default, EL can only access getters and setters on objects.
    It can not execute general methods on an object.
    You can define function libraries that call static methods
    You have to write the method as static, and then declare it in a tld.
    public boolean checkValid(Model m, Info i){ ...}
    and then you could invoke it something like
    <%@ taglib uri="myfunctionstaglib" prefix="myfunctions" %>
    ${myfunctions:checkValid(model, model.thisInfo)}

  • Behaviour  of JSTL c:choose tag on solaris .

    Hi
    I am using <c:choose> JSTL tag like
    <c:choose>
    <c:when..>
    </c:when>
    <c:when..>
    </c:when>
    <c:choose>
    instead of
    <c:choose>
    <c:when..>
    </c:when>
    <c:otherwise>
    </c:otherwise>
    <c:choose>
    It works fine on windows but not work on solaris.
    I am really confused . can any one plzz help me out?
    Thanks in advance

    That makes sense, but when I try other code like it, see below, it's not working again. Can you see anything wrong with this code?
    <select name="state">
    <c:forEach items="${pageBean.states}" var="state">
    <option value="<c:out value="${state.stateCode}" />"
    <c:choose><c:when test="${state.stateCode == detailsBean.state}"> selected="selected"</c:when>
    <c:otherwise><c:when test="${state.stateCode == 'PA'}"> selected="selected"</c:when></c:otherwise></c:choose>><c:out value="${state.stateCode}"/></option>
    </c:forEach>
    </select>
    The JSP won't display properly with the code this way, but it looks like what you suggested.

  • JSTL-c:import tag and c:param with portlets

    I am writing a JSP file in a portlet application to use the c:import JSTL tag to include a JSP file. However, I am trying to pass a parameter via c:param to this included file but the parameter is not being passed. The included JSP file gets "null" when trying to retrieve the value of this parameter, due to the fact that the parameter is not being passed. See code below:
    <c:import url="/jstltestportlet/jsp/html/test.jsp">
    <c:param name="month" value="October" />
    </c:import>
    Any ideas on why this is happening? Anybody running into this sort of a problem?
    I would appreciate any feedback.

    Here is my jsp #1: content.jsp (all the values are valid on this page)
    <c:import url="/org/j2eebuilder/view/Window.jsp">
    <c:param name="componentName" value="Home"/>
    <c:param name="componentStatus" value="None"/>
    <c:param name="windowAlias" value="/org/j2eebuilder/view/ViewControllerHelper.jsp"/>
    <c:param name="windowHeader" value="Home Management"/>
    </c:import>
    Here is my jsp #2: window.jsp (just showing various ways I have tried to get the value out)
    1. ${requestScope.componentName} 2. ${componentName} 3. ${param.componentName}
    4. <%=renderRequest.getAttribute("componentName")%>
    5. <%=renderRequest.getParameter("componentName")%>
    6. <%=request.getQueryString()%>
    7. <%= request.getParameter("componentName") %>
    8. <portlet:renderURL />
    9.<c:out value="${param.componentName}" />
    10.<c:out value="${componentName}" />
    and here is what is rendered:
    1.
    2.
    3.
    4. null
    5. null
    6. componentName=Home&componentStatus=None&windowAlias=%2forg%2fj2eebuilder%2fview%2fViewControllerHelper.jsp&windowHeader=Home+Management
    7. null
    8. /pluto/portal//Test Page
    9.
    10.

  • JSTL c:set tag replace single qoutes to & #039;

    Hi all,
    i'm using the JSTL-Tags to create and query a SQL-Statement.
    I use the c:set Tag to set a part of my query...
    <c:set var="selectSeveral" value="d.hardwarecode = '${param.p_macAddress}'"/>
    ...and the sql:query Tag to excecute the query:
    SELECT <c:out value="${selectValue}"/>
    FROM event e, device d, billingunit b
    WHERE e.eventdate >= to_date('<c:out value="${param.p_dateFrom}"/>', 'DD.MM.YYYY HH24:MI:SS')
    AND e.eventdate <= to_date('<c:out value="${param.p_dateTo}"/>', 'DD.MM.YYYY HH24:MI:SS')
    AND <c:out value="${selectSeveral}"/>
    AND e.deviceid = d.deviceid
    AND d.billingunitid = b.billingunitid
    GROUP BY <c:out value="${groupValue}"/>
    By excecuting the Statement with Tomcat i get a Oracle ORA-00911: invalid character Errormessage.
    I found the reason for this in the Logfile, where the Statement looks like this:
    SELECT e.eventdate, e.sessionend, e.sourceip, e.amount, d.hardwarecode, d.typecode, b.name, b.code
    FROM event e, device d, billingunit b
    WHERE e.eventdate >= to_date('17.03.2003 19:44:06', 'DD.MM.YYYY HH24:MI:SS')
    AND e.eventdate <= to_date('17.03.2003 20:54:59', 'DD.MM.YYYY HH24:MI:SS')
    AND e.sourceip = & #039;172.24.214.222& #039;
    AND e.deviceid = d.deviceid
    AND d.billingunitid = b.billingunitid
    ORDER BY eventdate asc
    As you can see JSTL replaced the single quotes with the number code of the single quotes. (& #039;)
    Any ideas how to solve this problem.
    Thanks in advance.
    Cu Daniel

    Try setting the escapeXml attribute to false - it defaults to true, and will replace XML (and HTML) special characters to their entity codes. For example:
    <c:out value="${selectValue}" escapeXml="false"/>

  • Can you set pager attribute using jstl c:out tag?

    I am trying to use the pager tag library from jsptags.com. The pager tag has a maxPageItems attribute. I want maxPageItems to be variable. I also want to use the jstl instead of scriptlets and expressions. Instead of writing
    <pg:pager
        maxPageItems="<%= myPageItems %>" >I want to write
    <pg:pager
        maxPageItems="<c:out value='myPageItems'/>">When I do this I get a java.lang.NumberFormatException: for input string: ""
    I think this issue is documented on the jsptags website. So maybe I have no choice but to use the expression format. I guess I should also mention that I am using jstl 1.1 and jsp 1.2 (implemented in tomcat 4.1.27)
    Has anyone tried this and had success?
    Did I provide enough information?

    Sorry, but you can't use tags as attributes to other tags (where would it end?)
    You're stuck with using <%= %> syntax.

  • Help on JSTL sql:query / tag

    Hi.....
    Currently i am trying to query a date from MSSQL using <sql> tag. I had tested in MSSQL on this SQL statement which is:-
    SELECT * FROM hr_leave WHERE startDate LIKE 'Apr 20 2006%'
    It can query my MSSQL datetime.
    Then , I apply this query inside my JSP/JSTL page which is :-
    <%@ include file="/common/header.jsp" %>
    <%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql" %>
    <jsp:useBean id="now" class="java.text.SimpleDateFormat"/> <!-- get current date -->
    <c:set var="userid" value="${sessionScope.currentUser.id}"/> <!-- get current user id -->
    <c:set var="dates"><fmt:formatDate value="${now}" type="DATE" pattern="MMM dd yyyy"/></c:set>
    <sql:setDataSource var="ds" driver="com.microsoft.sqlserver.jdbc.SQLServerDriver" url="jdbc:sqlserver://192.168.250.86:1223;DatabaseName=eleavedb;SelectMethod=cursor" user="sa" password="sapassword"/>
    <sql:query var="countLeave" dataSource="${ds}">
    SELECT * FROM hr_leave_entry WHERE startDate LIKE (?, '%')
    <sql:param value="${dates}"/>
    </sql:query>
    From the code above it displayed an an error for me. I am worried whether my select statement and my way of using the '%' symbol is it not correct.
    Can anyone guide me? Thank You!

    And the error was?
    No, that sql does not look valid the way that you have written it.
    Parameters are NOT copied/pasted into sql strings. They replace the value directly. So the correct sql would be
    SELECT * FROM hr_leave_entry WHERE startDate LIKE ?
    You would need to actually pass the parameter as 'Apr 20 2006%'

Maybe you are looking for

  • SSRS Dataset Column MetaData dynamic Update

    Hi All, I  have report which is dynamically pivoting columns    in the query ,i need to update those dynamic  columns on the ssrs    column metadata fields on the data set,cross tabbing using tablix doesn't work for my logic  ,is there any way ,the  

  • How do I stop Calendar from creating its own alerts?

    This is weird.  I Am not using Icloud, nor synching with any other calendar (as far as I know). But I create an event, put in one alert, and a few days later, it has three or more random alerts (even some well after the event). AND it will email me m

  • Dual boot on K410 window 8 with window XP pro

    Recently I had purchased K410-i7 window 8 x64 and want to make dual boot with window XP 64 pro. Would you please teach me how to do or if someone can do for me, I can pay service? I live in Cupertino, CA.   Thanks in advance.

  • Converting and storing videos and slideshows to/in MAC

    i am trying to figure out where to store my videos and slideshows (i use Aperture) but before i get there i am noticing that i am getting an error on some of my file types and also that i have a lot of different file types. does anyone know how to fi

  • ER: Auto create EO Alternate Keys based on table UKs

    Hi JDev gang Under TP4 and above for ADF BC, when we create an EO based on a db table which has both a database PK and a database unique key, it would be good to save the developer some work and automatically create an EO alternative key on the UK. C