Hi Ilya Shaikovsky ,
I have implemented as your suggestion but gett following error ,please do the needful help.
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: javax.servlet.ServletException: #{viewController.newAction}: javax.el.MethodNotFoundException: /examples/Include.xhtml @8,70 action="#{viewController.newAction}": Method not found: phoneTypesTopNavigationBean.newAction()
com.test.lbs.presentation.filter.HibernateSessionRequestFilter.doFilter(HibernateSessionRequestFilter.java:75)
root cause
javax.servlet.ServletException: #{viewController.newAction}: javax.el.MethodNotFoundException: /examples/Include.xhtml @8,70 action="#{viewController.newAction}": Method not found: phoneTypesTopNavigationBean.newAction()
javax.faces.webapp.FacesServlet.service(FacesServlet.java:256)
org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
com.test.lbs.presentation.filter.HibernateSessionRequestFilter.doFilter(HibernateSessionRequestFilter.java:48)
root cause
javax.faces.FacesException: #{viewController.newAction}: javax.el.MethodNotFoundException: /examples/Include.xhtml @8,70 action="#{viewController.newAction}": Method not found: phoneTypesTopNavigationBean.newAction()
com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:99)
javax.faces.component.UICommand.broadcast(UICommand.java:383)
org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:321)
org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:296)
org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:253)
org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:466)
com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
com.test.lbs.presentation.filter.HibernateSessionRequestFilter.doFilter(HibernateSessionRequestFilter.java:48)
root cause
javax.faces.el.MethodNotFoundException: javax.el.MethodNotFoundException: /examples/Include.xhtml @8,70 action="#{viewController.newAction}": Method not found: phoneTypesTopNavigationBean.newAction()
javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:81)
com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
javax.faces.component.UICommand.broadcast(UICommand.java:383)
org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:321)
org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:296)
org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:253)
org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:466)
com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
com.test.lbs.presentation.filter.HibernateSessionRequestFilter.doFilter(HibernateSessionRequestFilter.java:48)
root cause
javax.el.MethodNotFoundException: /examples/Include.xhtml @8,70 action="#{viewController.newAction}": Method not found: phoneTypesTopNavigationBean.newAction()
com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:72)
javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)
com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
javax.faces.component.UICommand.broadcast(UICommand.java:383)
org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:321)
org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:296)
org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:253)
org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:466)
com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
com.test.lbs.presentation.filter.HibernateSessionRequestFilter.doFilter(HibernateSessionRequestFilter.java:48)
The related files are
Include.xhtml
<!
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:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">
<h:commandButton action="#{viewController.newAction}" value="new"/>
</
html>
LandingPhoneType.xhtml
<!
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:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich"><
ui:composition template="/pages/templates/Main.xhtml">
<ui:define name="body" >
<h:form>
phone
<ui:include src="/examples/Include.xhtml" >
<ui:param name="viewController" value="phoneTypesTopNavigationBean" />
</ui:include>
</h:form>
</ui:define></
ui:composition></
html>
LandingCellType.xhtml
<!
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:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich"><
ui:composition template="/pages/templates/Main.xhtml">
<ui:define name="body" >
<h:form>
cell
<h:commandButton action="#{viewController.newAction}" value="new">
<ui:param name="viewController" value="cellTypesTopNavigationBean" /></h:commandButton>
</h:form>
</ui:define></
ui:composition></
html>
PhoneTypes.xhtml
<!
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:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich"><
ui:composition template="/pages/templates/Main.xhtml">
<ui:define name="body" >phoneType
</h:form>
</ui:define></
ui:composition></
html>
CellTypes.xhtml
<!
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:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich"><
ui:composition template="/pages/templates/Main.xhtml">
<ui:define name="body" >CellType
</h:form>
</ui:define></
ui:composition></
html>
TopNavigation.java
package
com.test.lbs.presentation.examples;
public
interface TopNavigation {
public String newAction();
}
CellTypesTopNavigationImpl.java
public
class CellTypesTopNavigationImpl implements TopNavigation {
@Override
public String newAction() {
return("newCellTypes");
// TODO Auto-generated method stub
}
}
PhoneTypesTopNavigationImpl.java
public
class PhoneTypesTopNavigationImpl implements TopNavigation {
@Override
public String newAction() {
// TODO Auto-generated method stub
return
("newPhoneTypes");}
}
Face-config.xml
<managed-bean>
<managed-bean-name>phoneTypesTopNavigationBean</managed-bean-name>
<managed-bean-class>com.test.lbs.presentation.examples.PhoneTypesTopNavigationImpl</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>cellTypesTopNavigationBean</managed-bean-name>
<managed-bean-class>com.test.lbs.presentation.examples.CellTypesTopNavigationImpl</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<navigation-rule>
<navigation-case>
<from-action>#{phoneTypesTopNavigationBean.newAction}</from-action>
<from-outcome>newPhoneTypes</from-outcome>
<to-view-id>/examples/PhoneTypes.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<navigation-case>
<from-action>#{cellTypesTopNavigationBean.newAction}</from-action>
<from-outcome>newCellTypes</from-outcome>
<to-view-id>/examples/CellTypes.xhtml</to-view-id>
</navigation-case>
</navigation-rule>