Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Navigation not working  RSS feed

 
Ranch Hand
Posts: 495
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 455
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what error are you getting ?

did you try this ?

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

Thanks,
 
Abiodun Adisa
Ranch Hand
Posts: 495
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 455
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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,
 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 495
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Still Not working
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!