1

I'm trying to import a project from CVS for the first time and I'm receiving the error "Can't find tag lib descriptor for " I'm receiving it for both of the taglib lines below. Any ideas on what I can do to troubleshoot this?

Snippet from one of the JSP's.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@ page contentType="text/html;charset=windows-1252"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
Catfish
  • 17,019
  • 47
  • 183
  • 323
  • Are you specified your project as a JSF project, specifying JSF Facet Settings with the corresponding libraries? – Aitor Aug 02 '11 at 16:49
  • Can you elaborate on how to do that? I just created a new dynamic project and tried to import all the files from CVS into my project. – Catfish Aug 02 '11 at 16:52
  • Maybe you can change the .jsp file to a .xhtml file like it's written in this post: http://stackoverflow.com/questions/6322127/can-not-find-the-tag-library-descriptor-for-http-java-sun-com-jsf-facelets it works for me – dani24 Oct 01 '15 at 19:38

2 Answers2

2

The project apparently didn't contain any JSF libraries. That can happen when the project is targeted on a runtime (a servletcontainer) which already ships with JSF libraries bundled. For example, Tomcat doesn't ship with JSF libraries bundled, but Glassfish, JBoss AS, Websphere, etc do.

You have 2 options:

  1. Manually download the desired JSF library (as you're using legacy JSP as view technology, I guess you need JSF 1.2 not 2.0), extract the zip, grab the jsf-api.jar and jsf-impl.jar files and drop them in /WEB-INF/lib folder.

  2. (Re)associate your dynamic web project with a target runtime which has JSF ilbraries bundled. Rightclick the project, choose Properties and configure the Targeted Runtimes entry.

Either way, Eclipse will do the needed magic to resovle this error.

BalusC
  • 992,635
  • 352
  • 3,478
  • 3,452
2

As @BalusC said, my option is associate your dynamic web project. You can do it in your project properties, click on project facets and add JSF. You can check this eclipse instructions:

http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.jst.jsf.doc.user%2Fhtml%2Ftasks%2Fadd_jsf_facet.html

Aitor
  • 2,941
  • 2
  • 23
  • 31
  • I had the jsf-api.jar and jsf-impl.jar files in the project. Once I added JSF in the project facets those errors went away. Thanks. – Catfish Aug 02 '11 at 18:41