Reply To: Need help with Navigation

Splash Forums PrettyFaces Users Need help with Navigation Reply To: Need help with Navigation

#26715

Andreu
Participant

Incidentally I removed part of the project, now navigation again doesn’t work, and don’t know why =/

index.xhtml – PrimeFaces element rendered list of categories.

        <h:form id="categories">
            <p:dataGrid var="category" value="#{categoryController.categories}" columns="4" layout="grid"
                        rows="16" id="cars">
                <f:facet name="header">
                    CATEGORIES
                </f:facet>
                <h:link outcome="somethingList">
                    <p:panel header="#{category.id}" style="text-align:center">
                        <h:panelGrid columns="1" style="width:100%">
                            <p:graphicImage library="indexImages" name="#{category.imageName}"/> 
                            <h:outputText value="#{category.description}" />
                        </h:panelGrid>
                    </p:panel>
                    <f:param name="category" value="#{category.categoryName}" />
                </h:link>
            </p:dataGrid>
        </h:form>

pretty-config.xml

    <url-mapping id="home">
        <pattern value="" />
        <view-id value="/faces/index.xhtml" />
    </url-mapping>
    
    <url-mapping parentId="home" id="viewCategory">
        <pattern value="/#{ category : categoryBean.categoryName }"/>
        <view-id value="/faces/somethingList.xhtml"/>
    </url-mapping>

but have error

FATAL:   JSF1072: com.ocpsoft.pretty.PrettyException caught during afterPhase() processing of RESTORE_VIEW 1 : UIComponent-ClientId=, Message=PrettyFaces: Exception occurred while processing <viewCategory:#{categoryBean.categoryName}> for URL </car>
FATAL:   PrettyFaces: Exception occurred while processing <viewCategory:#{categoryBean.categoryName}> for URL </car>
com.ocpsoft.pretty.PrettyException: PrettyFaces: Exception occurred while processing <viewCategory:#{categoryBean.categoryName}> for URL </car>
	at com.ocpsoft.pretty.faces.beans.ParameterInjector.injectPathParams(ParameterInjector.java:96)
	at com.ocpsoft.pretty.faces.beans.ParameterInjector.injectParameters(ParameterInjector.java:54)
	at com.ocpsoft.pretty.faces.event.PrettyPhaseListener.afterPhase(PrettyPhaseListener.java:102)
	at com.sun.faces.lifecycle.Phase.handleAfterPhase(Phase.java:189)
	at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:107)
	at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:121)
	at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198)
	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:646)
	at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:344)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
	at com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:145)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
	at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:873)
	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:739)
	at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:575)
	at org.apache.catalina.core.ApplicationDispatcher.doDispatch(ApplicationDispatcher.java:546)
	at org.apache.catalina.core.ApplicationDispatcher.dispatch(ApplicationDispatcher.java:428)
	at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:378)
	at com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:137)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:316)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
	at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
	at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
	at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:357)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:260)
	at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:188)
	at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
	at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
	at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)
	at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
	at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
	at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)
	at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
	at autocomplete.PlayerConverter.getAsObject(PlayerConverter.java:29)
	at com.ocpsoft.pretty.faces.beans.ParameterInjector.injectPathParams(ParameterInjector.java:85)
	... 48 more

Categories renderdered by MVC – have class Category, in DaoImpl add information from db to category Objects and show they on page with PF dataGrid. Create CDI CategoryBean for PrettyFaces and connect category Object with CategoryBean on page by <f:param> and pretty-config.xml.
Try different variants of solution, but don’t know how Pretty work inside and why show NullPointer Exection.
Please, tell me, what wrong, help undestand how Pretty work and do correct navigation.

  • This reply was modified 7 years ago by  Andreu.
  • This reply was modified 7 years ago by  Andreu.
  • This reply was modified 7 years ago by  Andreu.