1 Reply Latest reply on Feb 11, 2011 2:49 AM by Ilya Sorokoumov

    How to do breadcrumbs using richfaces JSF and spring?

    mckiran87 Newbie

      I tried to do implement breadcrumb application by saving the path in the bean but the problem is i am not able to bring it up that on the webpage

      the layout which needs to be inserted all the pages:

      <rich:spacer height = "30px"/>


          <a4j:form id="breadCrumb">

              <a4j:keepAlive beanName="breadCrumbBean" />

              Bread Crumbs:


                  <ui:repeat var="link" value="#{breadCrumbBean.path}">   path is the list of strings which stores the address

                      <h:outputText value ="#{link}"/>








      i have used the bean as phase listener also declare this class i faces-config life cycle and also in the spring xml files


      public class BreadcrumbBean implements PhaseListener


         private static final long serialVersionUID = 1L;

          private ArrayList<String> path = new ArrayList<String>();

          private String currentPage = "";

          private String newPage = "";

          private String requestedPage ="";

          private PhaseEvent event;

          private String link;

          private String home ="/faces/Home.faces";


          public BreadcrumbBean()






          public void afterPhase(PhaseEvent e) {

              if (e.getPhaseId() == PhaseId.RESTORE_VIEW) {

                  FacesContext context = e.getFacesContext();

                  HttpServletRequest request = (HttpServletRequest) context.getExternalContext().getRequest();




                  // System.out.println(link);

                   System.out.println("after  phase");






          private void displayPath()






               for (String paths:path)

               System.out.println("displaypath" + paths);



          public void linkToThisPage() throws ServiceException


              String link = FacesContext.getCurrentInstance().getExternalContext()



              for(String page : path)




                      PhaseEvent event = getEvent();






      //other functonality is igored for now

          private void redirect(String navigation, FacesContext context){

              context.getApplication().getNavigationHandler().handleNavigation(context, null, navigation);




          public void beforePhase(PhaseEvent event)


              System.out.println("before phase");




          private void resetBreadCrumb()







          public PhaseId getPhaseId()


              return PhaseId.RESTORE_VIEW;



      .....getters and setters


      it is not working i think the bean is getting populated