aspose file tools*
The moose likes JSF and the fly likes Navigation not working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Navigation not working" Watch "Navigation not working" New topic
Author

Navigation not working

Abiodun Adisa
Ranch Hand

Joined: Jan 17, 2002
Posts: 495
I am trying to navigate from a bean but its not Changing to the target Page


FacesContext context=FacesContext.getCurrentInstance();
context.getApplication().getViewHandler().createView(context,"/index.jsp");


any suggestions?
Rajeev Ravindran
Ranch Hand

Joined: Aug 27, 2002
Posts: 455
what error are you getting ?

did you try this ?

FacesContext.getCurrentInstance().getExternalContext().dispatch("NoDataFound.jsp");

Thanks,


SCJP, SCWCD, SCBCD, Oracle Certified Professional (SQL n PL/SQL)
Abiodun Adisa
Ranch Hand

Joined: Jan 17, 2002
Posts: 495
Originally posted by Rajeev Ravindran:
what error are you getting ?

did you try this ?

FacesContext.getCurrentInstance().getExternalContext().dispatch("NoDataFound.jsp");

Thanks,


Thanks for the reply the error I am getting is

**********************************************************************

2006-05-18 20:50:02.687 NOTIFICATION J2EE JSP0008 Unable to dispatch JSP Page : java.io.FileNotFoundException: D:\jdevstudiobase1013\jdev\mywork\Application1\FDM\public_html\nopagefound.jsp (The system cannot find the file specified.
)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at java.io.FileInputStream.<init>(FileInputStream.java:66)
at oracle.jsp.provider.JspFilesystemResource.fromStream(JspFilesystemResource.java:149)
at oracle.jsp.parse.XMLUtil.getFromStream(XMLUtil.java:227)
at oracle.jsp.runtimev2.JspPageCompiler.compilePage(JspPageCompiler.java:341)
at oracle.jsp.runtimev2.JspPageInfo.compileAndLoad(JspPageInfo.java:610)
at oracle.jsp.runtimev2.JspPageTable.compileAndServe(JspPageTable.java:634)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:370)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:478)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:401)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:719)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)
at com.evermind.server.http.ServletRequestDispatcher.unprivileged_forward(ServletRequestDispatcher.java:298)
at com.evermind.server.http.ServletRequestDispatcher.access$100(ServletRequestDispatcher.java:42)
at com.evermind.server.http.ServletRequestDispatcher$2.oc4jRun(ServletRequestDispatcher.java:205)
at oracle.oc4j.security.OC4JSecurity.doPrivileged(OC4JSecurity.java:283)
at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:209)
at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
at fdm.backing.Chart.categorySelecteds(Chart.java:53)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:126)
at oracle.adf.view.faces.component.UIXComponentBase.__broadcast(UIXComponentBase.java:1079)
at oracle.adf.view.faces.component.UIXEditableValue.broadcast(UIXEditableValue.java:247)
at oracle.adf.view.faces.component.UIXCollection.broadcast(UIXCollection.java:94)
at oracle.adf.view.faces.component.UIXTable.broadcast(UIXTable.java:205)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:249)
at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:343)
at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:78)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._invokeDoFilter(AdfFacesFilterImpl.java:367)
at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._doFilterImpl(AdfFacesFilterImpl.java:336)
at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl.doFilter(AdfFacesFilterImpl.java:196)
at oracle.adf.view.faces.webapp.AdfFacesFilter.doFilter(AdfFacesFilter.java:87)
at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
at org.ajaxanywhere.AAFilter.doFilter(AAFilter.java:46)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:627)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)
at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)
at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:218)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:119)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:230)
at oracle.oc4j.network.ServerSocketAcceptHandler.access$800(ServerSocketAcceptHandler.java:33)
at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:831)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
at java.lang.Thread.run(Thread.java:595)
Rajeev Ravindran
Ranch Hand

Joined: Aug 27, 2002
Posts: 455
did you try this ?
FacesContext.getCurrentInstance().getExternalContext().dispatch("NoDataFound.jsp");


i faced some issues with redirect and i didnt have much time to spend, the easier workaround is to forward to a simple jsp with a <c:redirect

thanks,
g madhava
Ranch Hand

Joined: Sep 14, 2001
Posts: 85
Looks like you are getting a 404 - Page not found exception.
The reason is because of the path.

Taken from the documentation.
path - Context relative path to the specified resource, which must start with a slash ("/") character.

FacesContext.getCurrentInstance().getExternalContext().dispatch("NoDataFound.jsp");

should be

FacesContext.getCurrentInstance().getExternalContext().dispatch("/WEB-APPLICATION-CONTEXT/PATH-TO-NoDataFound.jsp");

substitue WEB-APPLICATION-CONTEXT with your WebApplication Context.
and the "PATH-TO-NoDataFound.jsp" should be substituted with the path to NoDataFound.jsp relative to the Web-Application Context.
Abiodun Adisa
Ranch Hand

Joined: Jan 17, 2002
Posts: 495
Still Not working
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Navigation not working