This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JSF Tag Problem  RSS feed

 
peter kosmas
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • 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

 
dwarakanathan thiru
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You mean you are not able to locate the tag libs? Check your webinf/lib folder for TLDs.
 
Tim Holloway
Bartender
Posts: 18705
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • 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
  • 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?
 
Eswar Nec
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • 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).
 
Allen Lam
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • 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
Bartender
Posts: 18705
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • 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!
 
Michele Smith
Ranch Hand
Posts: 421
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!