- This topic has 4 replies, 2 voices, and was last updated 19 years ago by
Riyad Kalla.
-
AuthorPosts
-
ldrMemberHi, Im trying to get the example projects working in myeclipse but with no luck.
first of all im unsure which implementation to use when adding jsf capabilities:
– Sun JSF Reference Implementation 1.1.01
– MyFaces 1.0.9
– MyFaces 1.1.1moreover should I install jsp-2.0.jar ?
Then I have changed the following import:
//import net.sourceforge.myfaces.custom.fileupload.UploadedFile;
To -> import org.apache.myfaces.custom.fileupload.UploadedFile;and
//import net.sourceforge.myfaces.custom.navmenu.NavigationMenuItem;
To -> import org.apache.myfaces.custom.navmenu.NavigationMenuItem;Here is my web.xml:
************************************************************
<?xml version=”1.0″ encoding=”UTF-8″?>
<web-app xmlns=”http://java.sun.com/xml/ns/j2ee” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” version=”2.4″ xsi:schemaLocation=”http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd”>
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>/WEB-INF/faces-config.xml</param-value>
</context-param>
<listener>
<listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
</listener>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<filter>
<filter-name>MyFacesExtensionsFilter</filter-name>
<filter-class>org.apache.myfaces.component.html.util.ExtensionsFilter</filter-class>
<init-param>
<param-name>maxFileSize</param-name>
<param-value>20m</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>MyFacesExtensionsFilter</filter-name>
<url-pattern>*.jsf</url-pattern>
</filter-mapping>
</web-app>
************************************************************************When I use MyFaces 1.1.1 without jsp2.0 I get the following error:
************************************************************************
exceptionjavax.servlet.ServletException: The absolute uri: http://myfaces.sourceforge.net/tld/myfaces_ext_0_9.tld cannot be resolved in either web.xml or the jar files deployed with this application
javax.faces.webapp.FacesServlet.service(FacesServlet.java:121)
org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:122)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)root cause
javax.faces.FacesException: The absolute uri: http://myfaces.sourceforge.net/tld/myfaces_ext_0_9.tld cannot be resolved in either web.xml or the jar files deployed with this application
org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:421)
org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:352)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:107)
org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:122)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)Thanks in advance
Chris
Riyad KallaMemberChris,
If you plan to use the MyFaces taglibs, then you need to use the MyFaces implementation, in which case I would suggest the most recent 1.x release in that drop down. And no you shouldn’t add jsp-2.0.jar unless you are deploying to an older app server, that is what the popup explains when it asks you if you want it or not.
ldrMemberFound the root of the problem, here it goes…
Problem: Resolving absolute uri for tld (ex. myfaces -> http://myfaces.sourceforge.net/tld/myfaces_ext_0_9.tld)
Solution: Find the JAR that provides your myfaces extensions tags, and open it up, go into the META-INF dir and open one of the TLD files, look around the 5th line or so for a tag: <url>link</url> or <uri>link</uri> use whatever the link part is to update your web.xml entries OR if you are using the default URI, update your <%@taglib%> entries in your JSP files. In my case -> http://myfaces.apache.org/extensionsNow its running but still with errors, especially bc. I have mixed libs -> that is org.apache.myfaces…. and net.sourceforge.myfaces… very clumsy
Also earlier I had problems with JBoss 4 using the following taglibs for jsf:
<%@ taglib uri=”http://java.sun.com/jsf/html” prefix=”h”%>
<%@ taglib uri=”http://java.sun.com/jsf/core” prefix=”f”%>and had to change it to the following to get it working:
<%@ taglib uri=”/WEB-INF/html_basic.tld” prefix=”h” %>
<%@ taglib uri=”/WEB-INF/jsf_core.tld” prefix=”f” %>Havent done this yet for the myfaces-examples…
Hope this helps others
Chris
ldrMemberBTW thx Riyad 4 info
Riyad KallaMemberThank you for following up for others.
-
AuthorPosts