• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

JSF Tag Problem

 
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello i have a problem with my first project
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<?xml version="1.0"?>

<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<!DOCTYPE faces-config PUBLIC
"-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
"http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
the error is :
Cannot find tag library descriptor :http://java.sun.com/jsf/html" prefix="h" http://java.sun.com/jsf/html" prefix="h"
when i use the url it can't be found at the browser
can someone help me please with this ???
the full code is here

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You mean you are not able to locate the tag libs? Check your webinf/lib folder for TLDs.
 
Saloon Keeper
Posts: 28653
211
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This isn't really a URL, it's a URI (Uniform Resource Identifier). And it's true. Since it's only an identifier, no one ever intended it to be used as a URL in a browser so a page fetch using that value will fail.

However, if you have the proper libraries in the proper place in your webapp classpath, this URI will be found, registered, and resolved properly. For JEE-compliant webapp servers, the "f" and "h" namespaced URIs should be provided by the webapp server itself. For Tomcat, you'd have to include the jsf-impl.jar in the webapp's WEB-INF/lib directory. In all cases, you'd need the jsf-api.jar in the webapp's WEB-INF/lib directory.
 
dwarakanathan thiru
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In my case, its a jboss portal we use and we do have jsf-api jar in web-inf/lib. But somehow eclipse IDE discards that only 'f' and 'h'.
Any suggestions?
 
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I feel Your project does not have jsf related jar files. I am not sure about this.

http://docs.jboss.org/richfaces/latest_3_3_X/en/devguide/html/GettingStarted.html.

If you have use Netbeans IDE6.7.1 then No problem. Because i check it.

It has four steps for creating new JSF Project. The fourth step, you will choose JavaServer Faces option.
Now you can see jsf related library files under : Location : (C:/ or D:/ depends upon your operation system )/projectName/build/web/WEB-INF/lib
And also you can see netbeansIDE (Libraries).
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For any tag lib def validation problem by IDEs, a sure solution is to define it in web.xml

1. find your wanted tld files, from source packages, from jars, etc
2. put it under WEB-INF
3. add sections in web.xml, like:



It works in Eclipse and MyEclipse for me, solved TLD validation problems for jstl, struts, springs, velocity, faces, groovy...
 
Tim Holloway
Saloon Keeper
Posts: 28653
211
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the JavaRanch, Allen!

You've "awakened a zombie" as we call it - opening a thread so old that probably most of the original participants have forgotten all about it. We generally prefer that you start a new thread, actually.

You can still explicitly reference TLDs in web.xml, but it's rarely necessary anymore. For quite a few years now JSF has known to look in the META-INF folder of component jars for the TLD and pull it automatically.

Of course, it won't find it anyway if it's not spelled right!
 
Ranch Hand
Posts: 421
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>

This also does not work for me. I have read this post and it says something about the CLASSPATH environment variable. I was wondering if I could get more detailed information about that. I have set CLASSPATH environment variables before, but it was something like a "cook book" type situation and someone was telling me exactly what to put in there. I need some help. I have also emailed Tim directly to get clarification.

Thanks,
Midani
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic