JSTL function tld

I'm using the ${fn:substring()}
If I include it like this it works fine.
<%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
but I much prefer to point the uri to something in my WEB-INF directory. This is for an intranet application and assures that an internet connection is not required for the application to run.
What would the correct tld be?

No change is required.
You are already using the correct URI, and it is not using the internet to look it up.
Note that this is a URI and not a URL.
The difference? In a nutshell:
URI is a unique identifier
URL specifies a location on the internet.
Take a look at the JSP Specification section 7.3.2
Basically it says that it does not look up the reference on the internet, but searches all tld files in scope to see if they specify the appropriate URI. tlds in scope include any under WEB-INF directory, and any in jar files.
The tld in this case is bundled in the file standard.jar
It is called fn.tld.
Inside that file:
<description>JSTL 1.1 functions library</description>
  <display-name>JSTL functions</display-name>
  <tlib-version>1.1</tlib-version>
  <short-name>fn</short-name>
  <uri>http://java.sun.com/jsp/jstl/functions</uri>And that is how it resolves http://java.sun.com/jsp/jstl/functions to the functions tld: fn.tld.
Cheers,
evnafets

Similar Messages

  • Issue with functions.tld

    hi
    i have a issue regarding functions tld file.
    i have jar called standerds.jar. i have included it in my class path.
    now i can get the path for core, fmt tlds but i m not getting the file path for fn tld.
    in eclipse i cant use it.
    please help me.

    hanumant_s wrote:
    hi
    i m using the latest one. just downloaded it.
    it is supporting other tld files like core , fmt but not to functionsBoth versions of the JSTL are available for download so you could have very well downloaded the previous version. This seems more probable in the light of the fact that you can use all other libraries except functions which were added in 1.1 and were absent in 1.0.
    So, please read the pages at the links I gave earlier and also check that you're using the correct URI in your taglib attribute. At the very least, you'll get some background about the JSTL libraries that might save you trouble later.
    You can also browse this page:
    http://jakarta.apache.org/taglibs/doc/standard-doc/GettingStarted.html

  • JSTL functions in JDev 10g (9.0.5 preview)

    Hi everybody,
    I don't see the JSTL functions taglib available in the component palette for a JSP page. Is it something that will be present in the production version ?
    It seems that this taglib is also not available within OC4J 10.0.3 preview. So a page containing such a line will not compile:
    <%@ taglib uri="http://java.sun.com/jstl/functions" prefix="fn" %>Any comments ?

    Hi Shay,
    The new how-to covers JSTL SQL. What I'm interested in is JSTL functions.
    I want to be able to do something like:
    <%@ taglib uri="http://java.sun.com/jstl/functions" prefix="fn" %>
    <c:if test="${fn:length(param.username) > 0}" >
    </c:if>But maybe it's something relative to JSP 2.0 and not only to JSTL.

  • 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

  • JSTL Function Causing JDev Designer to Hide Field

    I added a JSTL function to an OutputText field in an ADF Web application. The function itself works at run-time; however, in the JDev Designer, the Designer does not display the field.
    What I did was this:
    1. Added the namespace prefix to the page fragment:
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:fn="http://java.sun.com/jsp/jstl/functions"
    xmlns:c="http://java.sun.com/jsp/jstl/core">
    2. Added the function to an af:outputText. To keep this post simple, in the below example i just used 'MMM' as the fn:toLowerCase() param value:
    <af:panelLabelAndMessage label="#{viewcontrollerBundle.LOGGER_PROTOTYPE_2}" id="plam4"
    rendered="#{bindings.Type1.inputValue !=2 and bindings.MessageLevelId.inputValue != 0}">
    <af:outputText value="#{fn:toLowerCase('MMM')}" id="ot4"
    inlineStyle="font-family:'Courier New', Courier, monospace;"/>
    </af:panelLabelAndMessage>
    At runtime 'MMM' is correctly displayed as 'mmm'. However, the field is not visible in the JDev Designer - which will make this confusing to maintain. Is there something I am doing wrong, or am i missing a step?
    Versions: JDeveloper 11.1.1.6, Linux. JSTL functions library is for v. 1.2.
    Thanks for your help.

    There is no JDev version 11.1.1.6.0 (at least officially).
    Anyway, can you check what you see if you add some static text in front of the EL.
    I guess jdev tries to calculate the value, fails and you end up getting nothing (or in case of an outputText with no text which means nothing).
    Timo

  • Does JSTL functions work in custom Spaces Page Style ?

    I am trying to create a custom page style and have to write some logic where I have to use fn:containsIgnoreCase. When I create pages that use this Page Style, it throws a white page and doesnt work.
    I have also added the below in the root
    xmlns:fn="http://java.sun.com/jsp/jstl/functions"
    xmlns:c="http://java.sun.com/jsp/jstl/core"
    When I remove the fn:containsIgnorecase, It works fine.
    My version of Webcenter Spaces is 11.1.1.6
    Edited by: Rohith puchalapalli on Apr 9, 2013 3:39 PM

    Hi.
    You can use JSTL perfectly in ADF. I don't share the opinion of Oracle not recommends... there are a lot of official pages saying how to use JSTL in ADF.
    <af:outputText value="#{fn:length(yourList)}"/>Yannick is saying that you can't mix lifecycles. Take care using $ or # operators :).
    For example if you are using a JSTL c:forEach. Next code is going to crash:
    <c:forEach var="..." value="${list}">
       <af:outputText value="#{list.item}"/>
    </c:forEach>Because # is evaluated in prepareModel phase and $ while rendering.
    I hope this help you.

  • No JSTL FUNCTION support

    Does Jdev support JSTL FUNCTION taglib?
    such sd EL ${fn:substringAfter("...") }
    I did not find it on the component palette.
    thanks

    Refer to
    http://www.oracle.com/technology/products/jdev/tips/schalk/jstl_sql/jstl_sql.html

  • Trouble with JSTL functions uri

    I have JSTL 1.1 installed, am using J2EE 1.3 on Websphere 5.0 and am referencing 2.3 DTD in my web.xml. I have the jstl.jar, standard.jar, jdbc2_0-stdext.jar, xalan.jar and xercesImpl.jar in WEB-INF/lib
    I can successfully use the core JSTL functions with
    <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> but have not been able to get the functions URI to work.
    I have tried the two listed below
    <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
    <%@ taglib uri="http://java.sun.com/jstl/functions" prefix="fn" %>
    but get the error:
    [Servlet Error]-[File "http://java.sun.com/jsp/jstl/functions" not found]: org.apache.jasper.JasperException: File "http://java.sun.com/jsp/jstl/functions" not found
    Can someone please tell me what I am doing wrong or if I am trying to use something that I shouldn't with my setup. I have only started using JSTL this week and have a lot left to learn.
    Thanks!

    I want to use JSTL 1.1 tags if possible. Not possible given your environment.
    Its on the header of the taglibs site:
    Standard-1.1 (JSTL 1.1) requires a JSP container that supports the Java Servlet 2.4 and JavaServer Pages 2.0 specifications. (http://jakarta.apache.org/taglibs/doc/standard-doc/intro.html)
    Websphere 5.0 supports only Servlet 2.3 and JSP 1.2. Thus you can only use JSTL1.0 with it. JSTL 1.0 does not define these functions.
    Sorry, but thats the way things are.
    Cheers,
    evnafets

  • Page Custimizations , using JSTL functions - R2

    Hi,
    We customize user pages by changing visibility of some fields according to some values. We do it by select page->Customize->view->source selecting the related field and typing the expression something like #{bindings.eventName.inputValue=='something'} here instead of operator I need to use contains. In jstl there exist function in the name contains, bu to use it I must include the namespace xmlns:fn="http://java.sun.com/jsp/jstl/functions" , can I do that? Can I confgure user pages using those jstl functions? Any help is strongly appreciated..
    BR,
    Aliye

    Hi,
    We customize user pages by changing visibility of some fields according to some values. We do it by select page->Customize->view->source selecting the related field and typing the expression something like #{bindings.eventName.inputValue=='something'} here instead of operator I need to use contains. In jstl there exist function in the name contains, bu to use it I must include the namespace xmlns:fn="http://java.sun.com/jsp/jstl/functions" , can I do that? Can I confgure user pages using those jstl functions? Any help is strongly appreciated..
    BR,
    Aliye

  • 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>

  • 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

  • Using replaceAll() function with jstl

    Hi All
    I am passing values from a child window to parent window.
    The child window has the following link on clinking of which the corresponding value pass to the parent window:
    <a href="#" onClick="closewindow('${stone.code}')">The argument in the closewindow() function passes to the parent window's text box.
    My problem comes when ${stone.code} contains the apostrophe in it.
    The java script gives the err as we know we should replace all occurances of
    ' with \' .
    But i am unable to do this in with the jstl.
    I have already spent a lot of time on it.
    Please help me if any body has any idea.
    Thanks a lot of you people in advance.

    The JSTL function taglib has a fn:replace tag. In your case, replace each singlequote with an escaped singlequote.
    TLDDOC: http://java.sun.com/products/jsp/jstl/1.1/docs/tlddocs/fn/replace.fn.html

  • When I mix JSTL 1.0 and 1.1 taglib declarations, it causes a ParseException

    When I mix JSTL 1.0 and JSTL 1.1 taglib declarations, it causes a ParseException on some of my servers, but not all of them.
    Here is the block of code that's giving me trouble:
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"%>
    <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
    <c:set var="TEXTVARIABLE">|STRINGOFTEXT|</c:set>
    <c:set var="OTHERTEXTVARIABLE">${fn:contains(TEXTVARIABLE, '|STRINGOFTEXT|')}</c:set>And here is the exception :
    *javax.servlet.jsp.JspException: com.caucho.jsp.JspLineParseException: /WEB-INF/jsp/online/system/modules/com.MYCOMPANY.marketing/templates/common/MY_JSP_PAGE.jsp:1: tag = 'out' / attribute = 'value': An error occurred while parsing custom action attribute "value" with value "${fn:contains(TEXTVARIABLE, '|STRINGOFTEXT|')}": org.apache.taglibs.standard.lang.jstl.parser.ParseException: EL functions are not supported.*
    However, everything works fine if I change the URI for the core declaration to *http://java.sun.com/jsp/jstl/core*
    So here's the really weird part: for some reason, mixing 1.0 and 1.1 taglib declarations only causes an exception on two of my servers, my staging server and my production server. It causes no problems at all on my local machine or my development server. Why is this? What could possibly be causing this difference in behavior?
    The three servers are extremely similar in setup and configuration. The JSP page is being served up by OpenCMS 7, and I'm using the Caucho's Resin webserver. I understand that you don't know how my servers or CMS are set up, but really, what I'm looking for is ideas. Any ideas at all would help, this problem has been driving me absolutely batty. Even if you don't know what could be causing the problem, if you have any suggestions at all for how I could approach the problem, that would be extremely helpful. I just don't understand what could cause this difference in behavior between my servers.
    For reference, here's the first part of the stack trace (there's a character limit in this forum, so unfortunately I can't post the whole thing) :
    *javax.servlet.jsp.JspException: com.caucho.jsp.JspLineParseException: /WEB-INF/jsp/online/system/modules/com.MYCOMPANY.marketing/templates/common/MY_JSP_PAGE.jsp:1: tag = 'out' / attribute = 'value': An error occurred while parsing custom action attribute "value" with value "${fn:contains(TEXTVARIABLE, '|STRINGOFTEXT|')}": org.apache.taglibs.standard.lang.jstl.parser.ParseException: EL functions are not supported. at*
    *org.opencms.jsp.CmsJspTagInclude.includeActionWithCache(CmsJspTagInclude.java:369) at*
    *org.opencms.jsp.CmsJspTagInclude.includeTagAction(CmsJspTagInclude.java:241) at*
    *org.opencms.jsp.CmsJspTagInclude.doEndTag(CmsJspTagInclude.java:472) at*
    *_jsp._WEB_22dINF._jsp._online._system._modules._com__MYCOMPANY__marketing._templates._MAIN_0PAGE__jsp._jspService(_MAIN_0PAGE__jsp.java:153) at*
    *com.caucho.jsp.JavaPage.service(JavaPage.java:60) at*
    *com.caucho.jsp.Page.pageservice(Page.java:579) at*
    *com.caucho.server.dispatch.PageFilterChain.doFilter(PageFilterChain.java:179) at*
    *shared.filter.RemoteAddrFilterBase.doFilter(RemoteAddrFilterBase.java:57) at*
    *com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70) at*
    *com.caucho.server.webapp.DispatchFilterChain.doFilter(DispatchFilterChain.java:115) at*
    *com.caucho.server.cache.CacheFilterChain.doFilter(CacheFilterChain.java:175) at*
    *com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:229) at*
    *com.caucho.server.webapp.RequestDispatcherImpl.include(RequestDispatcherImpl.java:485) at*
    *com.caucho.server.webapp.RequestDispatcherImpl.include(RequestDispatcherImpl.java:350) at*
    *org.opencms.flex.CmsFlexRequestDispatcher.includeExternal(CmsFlexRequestDispatcher.java:194) at*
    *org.opencms.flex.CmsFlexRequestDispatcher.include(CmsFlexRequestDispatcher.java:169) at*
    *org.opencms.loader.CmsJspLoader.service(CmsJspLoader.java:1193) at*
    *org.opencms.flex.CmsFlexRequestDispatcher.includeInternalWithCache(CmsFlexRequestDispatcher.java:423) at*
    *org.opencms.flex.CmsFlexRequestDispatcher.include(CmsFlexRequestDispatcher.java:173) at*
    *org.opencms.loader.CmsJspLoader.dispatchJsp(CmsJspLoader.java:1227) at*
    *org.opencms.loader.CmsJspLoader.load(CmsJspLoader.java:1171) at*
    *org.opencms.loader.A_CmsXmlDocumentLoader.load(A_CmsXmlDocumentLoader.java:232) at*
    *org.opencms.loader.CmsXmlContentLoader.load(CmsXmlContentLoader.java:52) at*
    *org.opencms.loader.CmsResourceManager.loadResource(CmsResourceManager.java:964) at*
    *org.opencms.main.OpenCmsCore.showResource(OpenCmsCore.java:1498) at*
    *org.opencms.main.OpenCmsServlet.doGet(OpenCmsServlet.java:152) at*
    *javax.servlet.http.HttpServlet.service(HttpServlet.java:115) at*
    *javax.servlet.http.HttpServlet.service(HttpServlet.java:92) at*
    *com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:106) at*
    *com.caucho.filters.CmsGzipFilter.doFilter(CmsGzipFilter.java:177) at*
    *com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70) at*
    *shared.filter.RemoteAddrFilterBase.doFilter(RemoteAddrFilterBase.java:57) at*
    *com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70) at*
    *com.caucho.server.webapp.DispatchFilterChain.doFilter(DispatchFilterChain.java:115) at*
    *com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:229) at*
    *com.caucho.server.webapp.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:277) at*
    *com.caucho.server.webapp.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:106) at*
    *com.caucho.server.dispatch.ForwardFilterChain.doFilter(ForwardFilterChain.java:80) at*
    *com.caucho.server.cache.CacheFilterChain.doFilter(CacheFilterChain.java:207) at*
    *com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:173) at*
    *com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:229) at*
    *com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:274) at*
    *com.caucho.server.port.TcpConnection.run(TcpConnection.java:514) at*
    *com.caucho.util.ThreadPool.runTasks(ThreadPool.java:520) at*
    *com.caucho.util.ThreadPool.run(ThreadPool.java:442) at*
    *java.lang.Thread.run(Thread.java:595)*
    Thanks for your help!

    My simple and stupid solution: Don't mix the two :-)
    You are not meant to be able to use the JSTL1.1 functions with JSTL1.0.
    What version of JSTL have you got installed on your servers?
    I presume it is one of JSTL1.1 or JSTL1.2?
    What jar files are present? Are they all the same version on the different servers?
    What version of Resin are you using?
    Are there any entries in the web.xml file for JSTL (correct answer is: no. There shouldn't have to be)
    Do you have any JSTL tld files sitting around your web app (again the correct answer is: no)
    Deep in the source code of the JSTL 1.1 parser, is this snippet:
    String allowed = System.getProperty("javax.servlet.jsp.functions.allowed");
        if (allowed == null || !allowed.equalsIgnoreCase("true"))
          {if (true) throw new ParseException("EL functions are not supported.");}I'm not sure what would set this property, but it might give you a lead...
    My recommendation: Use JSTL1.1 rather than JSTL1.0, and don't try to mix the two.

  • JSTL 1.1.2, TOMCAT 5.5, JDK 5, Eclipse and Problems

    I have been having trouble loading the JSTL library (standard.jar & jstl.jar)
    I'm using Eclipse 3.0.2 to do my development work on my JSP pages. So normally I will just create my Tomcat(5.5 on JDK5.0) project using Sysdeo(tm) plugin in its default directory (C:\eclipse\workspace\mytomcatproject).
    Then I would begin creating my JSPs and use JSTL(1.1.2) for my development. I'd put those standard.jar/jstl.jar into /WEB-INF/lib as recommended.
    The problem is I can't seem to get JSTL library working, even I tried out copy and pasting the example code into my pages.
    I have :
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
    ... //some code
    ${fn:escapeXml(param["myreq"])} will show out in the JSP exactly "${fn:escapeXml(param["myreq"])}" without processing. Although no runtime errors comes out (meaning the TOMCAT successfully loaded the library) but seems that the taglib is not working!!!
    I did some experiments:
    Experiment 1 :-
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
    (notice the uri, its without /jsp)
    and it works for /core taglib, but not the /functions taglib. Meaning somewhere in the TOMCAT library it load the older 1.0 version of JSTL.
    When I try using the /functions taglib
    <%@ taglib prefix="fn" uri="http://java.sun.com/jstl/functions" %>
    TOMCAT will complaint about the non-existence of this JSTL.
    Experiment 2 :-
    I tried to copy all the JSTL tld into my /WEB-INF/tld and and change my web.xml to include the tld location by using <jsp-config><taglib>.
    Doesn't work as well!!! The taglib just didn't get process.
    Experiment 3 :-
    I tried to modify the <Context> in server.xml to include tldNameAware and tldValidation to TRUE.
    Not Working as well!!!
    Experiment 4 :-
    I comment out the <my_tomcat_home>/conf/server.xml <Context> (the one that Eclipse created for my Tomcat project) and directly paste my project directory into <my_tomcat_home>/webapps and restarted my TOMCAT.
    IT WORKS!!!
    So does JSTL 1.1.2 only works in TOMCAT webapps home? Seems that TOMCAT only load the /WEB-INF/lib when the project is in its webapps, but when the project is outside of the webapps dir, it seems doesn't process the JSTL lib.
    Any idea how to make it work outside the Tomcat webapps cause I try to encourage my team to use Eclipse and CVS.

    The probable cause of the issue is your web.xml file.
    If your web.xml file is declared as being servlet version 2.3, then it disables the JSTL expression language (EL) by default.
    ie if you have this:
    <?xml version="1.0"?>
    <!DOCTYPE web-app PUBLIC
       "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
       "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>It should change to be this:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <web-app 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"
        version="2.4">Undo all of that hacking you did through the config files.
    JSTL needs no tld files, and no entries in web.xml to make it work.
    Hope this helps,
    evnafets

  • Accessing a JSTL variable in a JSP Scriptlet (need to replace string )

    I have
    <c:set var="myVar" value="..." />
    I need to replace single quotes and double quotes to be escaped because I pass them into javascript functions and set them as ID for div sections
    ... onclick ="func('${myVar}')" ..
    <div id="${myVar}">
    but if the string contains ' single quotes it messes up the javascript or double quotes messes up the ID portion of the HTML tag
    I know there is the JSTL function fn but I can't figure out how to do it properly in JSTL
    <c:set var="myVar"
    value="${fn:replace(myVar, "'", "\"")"/>
    But that gets tricky since the value portion is enclosed in quotes
    So I was thinking of using a Scriptlet part instead.

A: Accessing a JSTL variable in a JSP Scriptlet (need to replace string )

escaping quotes within quotes within quotes.... ARGH!
Recipe for a headache if ever there was one.
However you must be strong and resist the temptations of the dark side (Scriptlet code)
My suggestion for cleaning this up - write your own static function for escaping javascript strings.
public static String escapeJavascriptString(String s){
  return .......
}Then define the function in a tld:
<function>
    <description>
      Escapes a string for javascript purposes
    </description>
    <name>escapeJavascript</name>
    <function-class>com.mypackage.ELFunctions</function-class>
    <function-signature>java.lang.String escapeJavascript(java.lang.String)</function-signature>
    <example>
      <c:out value="${myfunc:escapeJavascript(name)}">
    </example>
  </function>Cheers,
evnafets

escaping quotes within quotes within quotes.... ARGH!
Recipe for a headache if ever there was one.
However you must be strong and resist the temptations of the dark side (Scriptlet code)
My suggestion for cleaning this up - write your own static function for escaping javascript strings.
public static String escapeJavascriptString(String s){
  return .......
}Then define the function in a tld:
<function>
    <description>
      Escapes a string for javascript purposes
    </description>
    <name>escapeJavascript</name>
    <function-class>com.mypackage.ELFunctions</function-class>
    <function-signature>java.lang.String escapeJavascript(java.lang.String)</function-signature>
    <example>
      <c:out value="${myfunc:escapeJavascript(name)}">
    </example>
  </function>Cheers,
evnafets

Maybe you are looking for

  • Problem in Display Dunning Letter - F150

    Dear Experts, While I run F150, for example for Customer XXXX. The Customer have 3 open item/ document number with different arrears (14, 60 and 180) which is the customer shoud be have 3 reminder letter (1, 2 and 3). But when I check the sample lett

  • Nike+ syncing doesn't work

    I had been looking into getthing the Nike+ kit for my 6th gen nano so I was really happy when the latest update removed the need for the extra hardware, and does everything natively on the nano.  However, after wasting several hours banging my head a

  • User-exit not getting triggered in VA32

    Hello Experts, Iu2019ve a requirement and Iu2019m working on Change Scheduling Agreement u2018t-code VA32u2019. According to requirement I need to capture all header data and data in Sales, Item Overview, Item Detail and Ordering party tabs. Iu2019ve

  • G5 with a dodgy hard drive?

    Hi I have a dual 2ghz G5 which has problems. The problem started when 5-10 mins after startup, the machine would crash, screen would hang and then the fans would rev up. I tried PRAM and then repaired disk with disk utility. SMART status says verifie

  • Propoportionally reduce size of image

    The help file says: To preserve the element's proportions (its width-to-height ratio) as you adjust its dimensions, Shift-drag the corner selection handle. When I SHIFT on the corner selection the HAND appears and not the size change icon...what give