Solved

Tomcat 5.0 JSTL 1.1 error when trying to loop over params

Posted on 2004-04-13
6
220 Views
Last Modified: 2013-11-24
I'm running Tomcat 5.0 using jstl 1.1 and have examples from oreilly under my webapps folder that don't have any problems with the following code.  Also, what is the best way to handle complex forms in JSP using JSTL?  Could someone please help.
When I attempt to do something like this:


<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<c:forEach items="${param}" var="current">
      <c:out value="${current.key}" />
      <c:out value="${current.value}" />
</c:forEach>


I get this error:
-----------------------------------
exception

org.apache.jasper.JasperException
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:358)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

root cause

java.lang.NullPointerException
      org.apache.jsp.testCheck_jsp._jspService(testCheck_jsp.java:180)
      org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
----------------------------------------
0
Comment
Question by:trobutta
  • 3
  • 2
6 Comments
 
LVL 27

Expert Comment

by:rrz
ID: 10823439
Your code works for me.
I could not reproduce the error. Which version of java are you using ?
Are you sure that you have the 1.1 jars ?
0
 
LVL 1

Author Comment

by:trobutta
ID: 10827792
currently using java 1.4.2

my WEB-INF/lib/ directory contains
  jstl.jar and standard.jar that I got from the

webapps\jsp-examples\WEB-INF\lib directory that installed with tomcat


I just realized the code I posted doesn't run in their examples folder either.
Should I try to up date the jar files?
0
 
LVL 1

Author Comment

by:trobutta
ID: 10827903
I got the freshest files from jakarta for jstl 1.1 and it still won't run for me.
The code does run under another folder that has an outdated jstl implementation..
but other things I'm doing don't run under that jstl implementation.
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 13

Expert Comment

by:copyPasteGhost
ID: 10828528
are you getting the same error with the new version of jstl?
Ghost
0
 
LVL 27

Accepted Solution

by:
rrz earned 125 total points
ID: 10828835
Do you have the 2.4 header on your context's web.xml file ?  
0
 
LVL 27

Expert Comment

by:rrz
ID: 10918388
>java.lang.NullPointerException
     org.apache.jsp.testCheck_jsp._jspService(testCheck_jsp.java:180)

Please show us line 180.   Look in Tomcat's work folder.   rrz
0

Featured Post

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
session migration servlets 2 42
How to increase Spring boot/Tomcat max file upload size 2 136
hibernate insert example 13 34
servlet and mdb, jms error 1 29
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

792 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question