views:

2172

answers:

1

I've been trying to get this to run, but I can't. I'm using Eclipse Galileo, Tomcat 5.5.23 and have several JSTLs around. My latest try was to use the glassfish jar file "jstl-impl-1.2.jar". I placed it in tomcat's shared lib, added it as external jar into my eclipe project and exported it.

Could anybody tell me, which jars to load in which folder and how to tell it to load in eclipse?

+6  A: 

It's very simple to include jstl in your projects, what I do is:

  1. Download jstl-1.2.jar (JSP 2.1 containers only i.e. Tomcat 6, otherwise jstl-1.1.jar) from https://maven-repository.dev.java.net/repository/jstl/jars/
  2. Copy jstl-1.2.jar to your project's WEB-INF/lib directory
  3. Include the following tags in yours jsp's:
    • <%@ 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" %>
    • <%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %>

As for eclipse I need to know if your using any framework plugin, I use MyEclipse and it does it automatically for me.

Juparave
I do not use any framework plugin; your solution is passed without error shown in Eclipse, but after export, deployment and start I get:"java.lang.NoClassDefFoundError: javax/el/ValueExpression"
Alex004
That could mean a lot of things Alex, I'll start by verifying if Java versions are the same from development environment and production environment. Also if there's already libraries in tomcat/common/lib. Are you using Tomcat 6? Try copying your el-api.jar and jstl-1.2.jar from your project to your production server's --> tomcat/common/lib
Juparave
I got it now: it is really a version problem as you stated in your first sentence. using tomcat 5.5 you have to use a jstl with version 1.1 (I downloaded it from jakarta taglibs)
Alex004
Good you have it working, good luck with the rest
Juparave