Cant use JSTL ${data}

  • Filter
  • Time
  • Show
Clear All
new posts

    Cant use JSTL ${data}

    Hi guys,
    I'm having a few teething problems with getting my java applications up and running. Tech support has ironed out problems with war file auto deployment which is now working a charm.
    My problem is that I can't seem to use JSTL data markup - ${variableName} - Tomcat simply refuses to process them as data. As a simple example, my redirect page looks like this;

    <%@taglib prefix="c" uri=""%>
    <c:set var="home"><c:url value="contacts.xhtm"/></c:set>
    <c:redirect url="${home}" />
    But the server redirects to the unprocessed value; /contextPath/${home} (clearly - does not exist)
    rather than /contextPath/contacts.xhtm.
    On both my development and test servers (both Tomcat 6), I am correctly forwarded to

    Whereas this is an easy one to work around by replacing the literal value, the behaviour seems to be repeated throughout all pages; I will post more code if needed but the above fragment gets it in a nut-shell.
    I'm guessing this a subtle config issue, I have both jstl.jar and standard.jar libraries in WEB-INF/lib/ but guess (and hope) I'm probably missing something really obvoius.

    Many thanks in advance for any advice


    After some digging around, I've found a fix; it was caused by tomcat version differences. Hopefully this may be usefull to others too.

    I'm guessing this a subtle config issue
    I've modified the servlet version in my web.xml to;
    <web-app version="2.4" 
    and everything works fine now!


      Thanks man you have just saved my life!