3 Replies Latest reply on Mar 13, 2008 12:03 PM by pdpantages

    menuItem using page navigation

    sandman202

      I am running across a problem when I use menuItem while trying to use page navigation in pages.xml. I created the project using seam. So, I am using facelets. On the rich:toolBar I have a few links: home, login, register. These sem to be directing to the correct screen. I am trying to create a rich:dropDownMenu where depending on the security.


      menu:

      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:s="http://jboss.com/products/seam/taglib"
       xmlns:rich="http://richfaces.org/rich">
      
      
       <h:form>
      
       <rich:toolBar xmlns="http://www.w3.org/1999/xhtml"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:s="http://jboss.com/products/seam/taglib"
       xmlns:rich="http://richfaces.org/rich">
      
       <rich:dropDownMenu value="Admin" rendered="#{s:hasRole('admin')}">
       <rich:menuItem value="User Search" action="/uzerEdit.xhtml"/>
       <rich:menuItem value="User Search" action="uzerEdit"/>
       </rich:dropDownMenu>
       </rich:toolBar>
       </h:form>
      </ui:composition>
      


      pages.xml
       <page view-id="*">
       <navigation>
       <rule if-outcome="home">
       <redirect view-id="/home.xhtml" />
       </rule>
       </navigation>
      
       <navigation from-action="uzerEdit">
       <redirect view-id="/uzerEdit.xhtml" />
       </navigation>
       </page>
      


      Whenever I click on either one of the UserEdit options, the screen comes back with:
      HTTP Status 404 - /artwork/uzerEdit.seam
      
      type Status report
      
      message /artwork/uzerEdit.seam
      
      description The requested resource (/artwork/uzerEdit.seam) is not available.
      JBossWeb/2.0.1.GA
      


      web.xml
      <?xml version="1.0" ?>
      <web-app 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-app_2_5.xsd"
       version="2.5">
      
       <!-- Ajax4jsf -->
      
       <context-param>
       <param-name>org.richfaces.SKIN</param-name>
       <param-value>blueSky</param-value>
       </context-param>
      
       <filter>
       <display-name>RichFaces Filter</display-name>
       <filter-name>richfaces</filter-name>
       <filter-class>org.ajax4jsf.Filter</filter-class>
       </filter>
      
       <filter-mapping>
       <filter-name>richfaces</filter-name>
       <servlet-name>Faces Servlet</servlet-name>
       <dispatcher>REQUEST</dispatcher>
       <dispatcher>FORWARD</dispatcher>
       <dispatcher>INCLUDE</dispatcher>
       </filter-mapping>
      
       <!-- Seam -->
      
       <listener>
       <listener-class>
       org.jboss.seam.servlet.SeamListener
       </listener-class>
       </listener>
      
       <servlet>
       <servlet-name>Seam Resource Servlet</servlet-name>
       <servlet-class>
       org.jboss.seam.servlet.SeamResourceServlet
       </servlet-class>
       </servlet>
      
       <servlet-mapping>
       <servlet-name>Seam Resource Servlet</servlet-name>
       <url-pattern>/seam/resource/*</url-pattern>
       </servlet-mapping>
      
       <filter>
       <filter-name>Seam Filter</filter-name>
       <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
       </filter>
      
       <filter-mapping>
       <filter-name>Seam Filter</filter-name>
       <url-pattern>/*</url-pattern>
       </filter-mapping>
      
      
      
       <!-- Facelets development mode (disable in production) -->
      
       <context-param>
       <param-name>facelets.DEVELOPMENT</param-name>
       <param-value>true</param-value>
       </context-param>
      
       <!-- JSF -->
      
       <context-param>
       <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
       <param-value>.xhtml</param-value>
       </context-param>
      
       <servlet>
       <servlet-name>Faces Servlet</servlet-name>
       <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
       <load-on-startup>1</load-on-startup>
       </servlet>
      
       <servlet-mapping>
       <servlet-name>Faces Servlet</servlet-name>
       <url-pattern>*.seam</url-pattern>
       </servlet-mapping>
      
       <security-constraint>
       <display-name>Restrict XHTML Documents</display-name>
       <web-resource-collection>
       <web-resource-name>XHTML</web-resource-name>
       <url-pattern>*.xhtml</url-pattern>
       </web-resource-collection>
       <auth-constraint>
       <role-name>NONE</role-name>
       </auth-constraint>
       </security-constraint>
      
      </web-app>
      


      Can anyone tell me why it is looking at "seam" and not "xhtml"?



        • 1. Re: menuItem using page navigation
          sandman202

          Ok, I was able to get it to work up to a point. Here is the issue now. I have my userEdit located:

          project -> view -> user.xhtml

          and menu as:

          <rich:menuItem value="User Search" action="/uzer.xhtml"/>

          This works fine. However, if I change the location of the xhtml to:

          project -> view -> admin -> user.xhtml

          and make the change under menu to :

          <rich:menuItem value="User Search" action="/admin/uzer.xhtml"/>

          it is unable to locate the xhtml. Does anyone have any idea?

          • 2. Re: menuItem using page navigation

            as far you use the custom navigation feature of Seam, it is a question to Seam, not to RichFaces

            • 3. Re: menuItem using page navigation
              pdpantages

              Hello sandman202,

              This might just be a typo in your post, but you said you moved the file to user.xhtml , but your menu refers to uzer.xhtml (different spelling).


              PdP