Results 1 to 2 of 2
  1. #1
    dark-sun is offline Member
    Join Date
    Jan 2011
    Posts
    2
    Rep Power
    0

    Unhappy issue with jstl 1.1 and tomcat 7.0

    well i know, this is crazy but it's real, here's the jsp source:
    Java Code:
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
    <html>
    <head>
    	<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
    	<title>A JSP Page With Parameter Looping</title>
    </head>
    <body>
    this is it! <br>
    <c:forEach begin="1" end="5" step="1">
    	This is from inside the loop.<br>
    </c:forEach>
    <c:out value='${header["host"]}' />
    <c:out value="${10 mod 4}" />
    <c:out value='${pageContext.request.contextPath}' />
    <br>
    <c:forEach items="${param}" var="pin">
    	param name: <c:out value="${pin.key}" />
    	value: <c:out value="${pin.value}" /> 
            btw, <c:out value="${param}" /> <br>
            <h2> kkk </h2>
    </c:forEach>
    
    </body>
    </html>
    and this is the answer from tomcat:
    Java Code:
    this is it!
    This is from inside the loop.
    This is from inside the loop.
    This is from inside the loop.
    This is from inside the loop.
    This is from inside the loop.
    ${header["host"]} ${10 mod 4} ${pageContext.request.contextPath}
    param name: ${pin.key} value: ${pin.value} btw, ${param}
    kkk
    i don't know what's wrong. i'm loosing my mind. :confused:

  2. #2
    dark-sun is offline Member
    Join Date
    Jan 2011
    Posts
    2
    Rep Power
    0

    Lightbulb source OK, metafile probably not

    Far as i see, source is O.K. but from tomcat output i guess there should be something wrong with metafiles. ensure "web.xml" has proper attributes and tags. specially <web-app> tag.
    for tomcat 7 it should be something like this:
    Java Code:
    <web-app xmlns="http://java.sun.com/xml/ns/javaee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
                          http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
      version="3.0">
    to make sure about metafiles attributes and tags, check $CATALINA_HOME/webapps/examples/WEB-INF/web.xml
    and to make sure about you libs, simply copy contents of '$CATALINA_HOME/webapps/examples/WEB-INF/lib' directory to your application lib directory.

    good luck ;)

Similar Threads

  1. Eclipse and Tomcat 6+7 issue
    By Sno in forum Eclipse
    Replies: 0
    Last Post: 01-22-2011, 09:11 PM
  2. Replies: 2
    Last Post: 07-24-2009, 02:26 PM
  3. Tomcat Issue
    By sanyog24681 in forum Java Servlet
    Replies: 1
    Last Post: 10-20-2008, 10:08 AM
  4. Replies: 0
    Last Post: 04-21-2008, 07:21 AM
  5. Tomcat In Eclipse - Sysdeo Tomcat Plug-in
    By JavaForums in forum Eclipse
    Replies: 1
    Last Post: 02-13-2008, 11:33 AM

Tags for this Thread

Posting Permissions

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