JSF Directive

<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>

<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>

URI in struts replaced with location of tag tld files.I heard tld files of Core and html tld file are in the jsf-impl.jar file.

where sould we need to place this(jsf-impl.jar) jar file .

and what should be URI location in the directive could any help me to get clarified.

[448 byte] By [rrajesh23a] at [2007-11-27 4:30:27]
# 1

If you want to use the packages/classes/files from an JAR, you have to put the JAR file in the classpath of the running Java environment, or to add the path of the JAR file to the classpath of the running Java environment.

One of the default paths of the classpath of a WAR is the /WEB-INF/lib. Put the JAR's in there.

BalusCa at 2007-7-12 9:39:43 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

I haven't reached you properly i guess,

here is complete code<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>

<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>

<f:loadBundle basename="game.messages" var="msg"/>

<html>

<head>

<title>inputnumber.jsp</title>

</head>

<body>

<f:view>

<h:form id="inputNumbers">

<h:outputText value="#{msg.how_to_play}"/>

<h:messages style="color: blue"/>

<h:inputText value="#{numberBean.userNumber}" required="true">

<f:validateLongRange minimum="0" maximum="100"/>

</h:inputText>

<h:commandButton value="#{msg.makeguess_button}" action="#{numberBean.checkGuess}"/>

</h:form>

</f:view>

</body>

</html>

jsf-impl.jar.

jsf-impl.jar file contains following folders

com , javax, META-INF folders.

with in META-INF folders, there are html_basic, jsf_core tld file.

my doudts is should we need to extract the jar file and place the tld files in the WEB-INF as in struts or we sould extract the jar files.

sould we need to write the derivative like below,

<%@ taglib uri="/WEB-INF/LIB/META-INF/html_basic.tld" prefix="h" %>

<%@ taglib uri="/WEB-INF/LIB/META-INF/jsf_core.tld" prefix="b" %>

or

sould we need to write the derivative like below,

<%@ taglib uri="/WEB-INF/LIB/html_basic.tld" prefix="h" %>

<%@ taglib uri="/WEB-INF/LIB/jsf_core.tld" prefix="f" %>

i am new to jsf could please clarify me. i have knowledge about struts.

rrajesh23a at 2007-7-12 9:39:43 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

I haven't reached you properly i guess,

here is complete code<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>

<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>

<f:loadBundle basename="game.messages" var="msg"/>

<html>

<head>

<title>inputnumber.jsp</title>

</head>

<body>

<f:view>

<h:form id="inputNumbers">

<h:outputText value="#{msg.how_to_play}"/>

<h:messages style="color: blue"/>

<h:inputText value="#{numberBean.userNumber}" required="true">

<f:validateLongRange minimum="0" maximum="100"/>

</h:inputText>

<h:commandButton value="#{msg.makeguess_button}" action="#{numberBean.checkGuess}"/>

</h:form>

</f:view>

</body>

</html>

jsf-impl.jar.

jsf-impl.jar file contains following folders

com , javax, META-INF folders.

with in META-INF folders, there are html_basic, jsf_core tld file.

my doudts is should we need to extract the jar file and place the tld files in the WEB-INF as in struts or we sould extract the jar files.

sould we need to write the derivative AS,

<%@ taglib uri="/WEB-INF/LIB/META-INF/html_basic.tld" prefix="h" %>

<%@ taglib uri="/WEB-INF/LIB/META-INF/jsf_core.tld" prefix="b" %>

or

sould we need to write the derivative like below,

<%@ taglib uri="/WEB-INF/LIB/html_basic.tld" prefix="h" %>

<%@ taglib uri="/WEB-INF/LIB/jsf_core.tld" prefix="f" %>

i am new to jsf could please clarify me. i have knowledge about struts.

rrajesh23a at 2007-7-12 9:39:43 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
You don't need to extract the JAR's nor to change the directive.Or you may elaborate a bit more what exactly you want to achieve. As far I understand is that you just want to get JSF running.
BalusCa at 2007-7-12 9:39:43 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5

I down loaded sample application from the internet.

i wanted to run in the tomcat.

there is URI directive is http://java.sun.com/jsf/html in the jsp file.

will it look for tld file in the above URL.

if framework looks for tld file in the above URL for the tld files of core and html tags , what happens if I don't have internet connetion, since internet access is needed for URL tld file..

rrajesh23a at 2007-7-12 9:39:43 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 6

> what happens if I don't have internet connetion, since internet

> access is needed for URL tld file..

Internet access is needed anyway to visit a website.

Well .. If you really want to store those tld files locally, then you indeed need to extract them and put it in the webcontainer. If you want to keep it invisible for visitors, then put it in WEB-INF. You can just use relative paths, it doesn't matter how the path is named.

BalusCa at 2007-7-12 9:39:43 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...