0

i'm doing some stuff with primefaces om eclipse indigo, i made a dynamic web project and selects the project facets and included the primefaces jar primefaces-3.5.jar i made a new xhtml page and write some code to make a new menubar, these is the final page that i run :

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui"> <h:head></h:head> <h:body> <h:form> <p:growl id="messages"/> <h3>Default Menubar</h3> <p:menubar> <p:submenu label="File" icon="ui-icon-document"> <p:submenu label="New" icon="ui-icon-contact"> <p:menuitem value="Project" url="#" /> <p:menuitem value="Other" url="#" /> </p:submenu> <p:menuitem value="Open" url="#" /> <p:separator /> <p:menuitem value="Quit" url="#" /> </p:submenu> <p:submenu label="Edit" icon="ui-icon-pencil"> <p:menuitem value="Undo" url="#" icon="ui-icon-arrowreturnthick-1-e" /> <p:menuitem value="Redo" url="#" icon="ui-icon-arrowreturnthick-1-e" /> </p:submenu> <p:submenu label="Help" icon="ui-icon-help"> <p:menuitem value="Contents" url="#" /> <p:submenu label="Search" icon="ui-icon-search"> <p:submenu label="Text"> <p:menuitem value="Workspace" url="#" /> </p:submenu> <p:menuitem value="File" url="#" /> </p:submenu> </p:submenu> <p:submenu label="Actions" icon="ui-icon-gear"> <p:submenu label="Ajax" icon="ui-icon-refresh"> <p:menuitem value="Save" actionListener="#{menuBean.save}" icon="ui-icon-disk" update="messages"/> <p:menuitem value="Update" actionListener="#{menuBean.update}" icon="ui-icon-arrowrefresh-1-w" update="messages"/> </p:submenu> <p:submenu label="Non-Ajax" icon="ui-icon-newwin"> <p:menuitem value="Delete" actionListener="#{menuBean.delete}" icon="ui-icon-close" update="messages" ajax="false"/> </p:submenu> </p:submenu> <p:menuitem value="Quit" url="http://www.primefaces.org" icon="ui-icon-close" /> <f:facet name="options"> <p:inputText style="margin-right:10px"/> <p:commandButton type="button" value="Logout" icon="ui-icon-extlink" /> </f:facet> </p:menubar> </h:form> </h:body> </html> 

the output of the page is :Default Menubar Note i get these sample from the prime faces tutorials page

4
  • Whats issue you are getting you did not mentioned? Commented Apr 24, 2013 at 11:10
  • i said that the page only outputs "Default Menubar" and no menu bars appears as its shown on the primefaces tutorials Commented Apr 24, 2013 at 11:12
  • please see in the console its show any error (both server and browser console) Commented Apr 24, 2013 at 11:18
  • Ok do one thing comment whole code and just add a single Primefaces textbox only in the page and see if it rendered or not Commented Apr 24, 2013 at 11:21

1 Answer 1

1

Apparently you didn't include the PrimeFaces JAR file properly in the webapp's runtime classpath.

Here are the steps (well, step), you need to perform in a Dynamic Web Project in Eclipse in order to include a 3rd party JAR file properly in webapp's runtime classpath.

  1. Drop the JAR file straight in project's /WEB-INF/lib folder.

That's all.

If you have ever fiddled around in project's Build Path properties in an attempt to achieve/fix it, then you need to make absolutely sure that you undo it all, or it may still cause conflicts/clashes.

Sign up to request clarification or add additional context in comments.

2 Comments

Did you successfully complete a basic JSF tutorial / HelloWorld example? Are you able to get <h:xxx>, <f:xxx> and <ui:xxx> to work? Rightclick the page in browser and View Source. If they are still there (along with <p:xxx> tags), then it simply means that the request URL as you see in browser's address bar did not match the URL pattern as you've definied for the FacesServlet. It's the one responsible for performing all the JSF works of producing the desired HTML output.
your assumption was right, the jar file needs to be put in the lib folder of the WEB_INF it should work from the first time but the browser was caching

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.