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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem with taglibs

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
I am using myfaces 1.2.5, Tomcat 6.0, eclipse 3.4.1, jdk 1.5 for my project. I have used FACES IDE from Ameterus for development. I am facing two problems :

1) In my JSP pages sometimes compiler accepts JSF tags like <h:outputText> <h:commandButton> but sometimes they are not compiled. The behaviour is random. Also text completion using cntr+space works sometime for these tags while sometime it fails. Although I m using JSP 2.x and servlet 2.5 as per Tomcat 6.x but still I am giving taglib location in my web.xml. I have copied myfaces_core, myfaces_html from lib/META-INF folder to tld folder in WEB-INF.

My sample JSP and Web.xml is as follows:
<%@ page contentType="text/html; charset=Cp1252" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Cp1252"/>
<title></title>
</head>
<body>
<f:view>
<h:panelGrid columns="2" border="0" cellspacing="5">

<h:outputText value="File Name:"/>
<h:outputText value="#{myBean.myFile.name}"/>

<h:outputText value="File Size:"/>
<h:outputText value="#{myBean.myFile.size}"/>

<h:outputText value="Param:"/>
<h:outputText value="#{myBean.myParam}"/>

<h:outputText value="Result:"/>
<h:outputText value="#{myBean.myResult}"/>

</h:panelGrid>
</f:view>
</body>
</html>

web.xml

<taglib>
<taglib-uri>http://java.sun.com/jsf/html</taglib-uri>;
<taglib-location>/WEB-INF/tld/myfaces_html.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://java.sun.com/jsf/core</taglib-uri>;
<taglib-location>/WEB-INF/tld/myfaces_core.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://myfaces.apache.org/tomahawk</taglib-uri>;
<taglib-location>/WEB-INF/tld/tomahawk.tld</taglib-location>
</taglib>

2.) myfaces_core in tld folder is giving following error

cvc-elt.1: Cannot find the declaration of element 'taglib' This error is in <taglib> tag of tld.

The tag is :<taglib xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd"
version="2.1">

Due to this there are warnings :
schema_reference.4: Failed to read schema document 'http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>

Please help in this regard
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Please do not cross-post the same question in multiple forums. It wastes people's time when multiple redundant conversations take place. Please read this for more information.
 
Eat that pie! EAT IT! Now read this tiny ad. READ IT!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
    Bookmark Topic Watch Topic
  • New Topic