This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes JSF and the fly likes redirect issue with jsf / jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "redirect issue with jsf / jsp" Watch "redirect issue with jsf / jsp" New topic
Author

redirect issue with jsf / jsp

Rajeev Ravindran
Ranch Hand

Joined: Aug 27, 2002
Posts: 455
Hi,

I am trying to forward the request from a jsp page to JSF page. I tried the c:redirect tag and it worked fine, but since the forward was from a plain JSP to JSF i think the faces context was not getting executed and its messing up my application.

Can someone help me with any alternate solution. I tried the following options
1. defined my redirect jsp as a servlet in the web.xml


<servlet>
<servlet-name>redirectJSP</servlet-name>
<jsp-file>/RedirectNewRegular.jsp</jsp-file>
</servlet>

<servlet-mapping>
<servlet-name>redirectJSP</servlet-name>
<url-pattern>RedirectNewRegular.faces</url-pattern>
</servlet-mapping>



it doesnt work though

2. I changed the redirect jsp to JSF and tried to forward to the new jsp from onPageLoadBegin of redirect JSF. Its showing me this exception

[11/6/06 10:48:03:750 EST] 00000060 ServletWrappe E SRVE0068E: Could not invoke the service() method on servlet /redirectjsf.jsp. Exception thrown : javax.servlet.ServletException: Assertion Failed
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:637)
at com.ibm._jsp._redirectjsf._jspService(_redirectjsf.java:86)
at com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:88)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1212)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1173)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:69)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:626)
at com.ibm.wsspi.webcontainer.servlet.GenericServletWrapper.handleRequest(GenericServletWrapper.java:117)
at com.ibm.ws.jsp.webcontainerext.JSPExtensionServletWrapper.handleRequest(JSPExtensionServletWrapper.java:171)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:250)
at com.ibm.faces.context.MultipartExternalContextImpl.dispatch(MultipartExternalContextImpl.java:411)
at ca.aigug.apps.origination.backingbeans.NewRegularInitializer.onPageLoadBegin(NewRegularInitializer.java:144)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java(Compiled Code))
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java(Compiled Code))
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))
at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:127)
at com.ibm.faces.renderkit.html_extended.ScriptCollectorRenderer.encodeBegin(ScriptCollectorRenderer.java:62)
at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:711)
at javax.faces.webapp.UIComponentTag.encodeBegin(UIComponentTag.java:572)
at javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:459)
at com.ibm.faces.taglib.html_extended.ScriptCollectorTag.doStartTag(ScriptCollectorTag.java:109)
at com.ibm._jsp._NewRegularInitializer._jspx_meth_hx_scriptCollector_0(_NewRegularInitializer.java:554)
at com.ibm._jsp._NewRegularInitializer._jspx_meth_f_view_0(_NewRegularInitializer.java:588)
at com.ibm._jsp._NewRegularInitializer._jspService(_NewRegularInitializer.java:82)
at com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:88)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1212)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1173)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:69)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:626)
at com.ibm.wsspi.webcontainer.servlet.GenericServletWrapper.handleRequest(GenericServletWrapper.java:117)
at com.ibm.ws.jsp.webcontainerext.JSPExtensionServletWrapper.handleRequest(JSPExtensionServletWrapper.java:171)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:250)
at com.ibm.faces.context.MultipartExternalContextImpl.dispatch(MultipartExternalContextImpl.java:411)
at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:249)
at com.otrix.faces.shared.ondemand.OnDemandViewHandler.renderView(OnDemandViewHandler.java:128)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:201)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1212)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1173)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:92)
at ca.aigug.apps.origination.filters.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:32)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:142)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:77)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:626)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:80)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1657)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:77)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:421)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:367)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:276)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminaters(NewConnectionInitialReadCallback.java:201)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:103)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java:548)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java(Compiled Code))
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:934)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1021)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1332)



Any alternate solution ? Appretiate any help on this..

Thanks,
Rajeev
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: redirect issue with jsf / jsp