Newbie - JSF question

Z

zalek

I am learning about JSF from the site http://exadel.com/tutorial/jsf/jsftutorial-kickstart.html
There is an example of JSP program:
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<f:loadBundle basename="jsfks.bundle.messages" var="msg"/>

<html>
<head>
<title>enter your name page</title>
</head>
<body>
<f:view>
<h1>
<h:eek:utputText value="#{msg.inputname_header}"/>
</h1>
<h:form id="helloForm">
<h:eek:utputText value="#{msg.prompt}"/>
<h:inputText value="#{personBean.personName}" />
<h:commandButton action="greeting" value="#{msg.button_text}" />
</h:form>
</f:view>
</body>
</html>

When I try to run it I am getting:

exception

org.apache.jasper.JasperException: This absolute uri (http://
java.sun.com/jsf/html) cannot be resolved in either web.xml or the jar
files deployed with this application

I checked web.xml - there is no reference to any http://java.sun.com/jsf/html.
Any ideas what is a problem?

Thanks,

Zalek
 
M

Mark Space

zalek said:
I am learning about JSF from the site http://exadel.com/tutorial/jsf/jsftutorial-kickstart.html
There is an example of JSP program:
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
I checked web.xml - there is no reference to any http://java.sun.com/jsf/html.
Any ideas what is a problem?

Here's a bit more info that I've dug up. There's two ways of specifying
a taglib file. First, in J2EE 1.x, you need to add a <taglib> element
in your web.xml.

<web-app>
<jsp-config>
<taglib>
<taglib-uri>http://java.sun.com/whatever</taglib-uri>
<taglib-location>/WEB-INF/myStuff.tld</taglib-location>
</taglib>
</jsp-config>
//... etc

That's what you're missing. You need the .tld for JSF too, which is
probably hiding inside the jsf-impl.jar file.

If you are using Java EE 2.0, then you don't need the <taglib> element.
The server will just magically look in several places in your /WEB-INF
directory. The easiest is just the root (/WEB-INF/myStuff.tld) so you
can make sure the .tld gets put there.

The tutorial is probably assuming a 2.0 spec, which needs no <taglib>
and you have 1.x, which requires one. Hence the error. That's my best
guess.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top