Results 1 to 3 of 3
  1. #1

    Question 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;

    Code:
    <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
    ....
    ....
    <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
    /contextPath/contacts.xhtm

    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

  2. #2

    Lightbulb Fixed

    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;
    Code:
    <web-app version="2.4" 
    ....
    and everything works fine now!

  3. #3

    Default

    Thanks man you have just saved my life!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •