servlets - Request forwarding contains result of the jsf page/bean that does the forward -
having strange problem request forwarding jsf bean. request being forwarded without issue. forward url page showing in browser correctly except that, @ bottom of page, contains result of forward jsf page.
i've tried perform response.reset() before doing forwarding. still not working.
i use balus's handy lifecyclelistner see going on. below see
- systemout o start phase restore_view(1)
- systemout o end phase restore_view(1)
- systemout o start phase render_response(6)
- systemout o manage bean doing forward
- systemout o in forward app
- systemout o end phase render_response(6) => render_reponse phrase
i guess when comes render_response phrase, append jsf page end of forward page.
my forwarding code looks below:
public void forwardhttprequestto(string url) { try { httpservletrequest request = gethttpservletrequest(); httpservletresponse response = gethttpservletrespose(); try {response.reset();} catch (exception ex) {ex.printstacktrace();}; requestdispatcher dispatcher = request.getrequestdispatcher(url); dispatcher.forward(request, response); } catch (exception ex) { throw (runtimeexception) ex; } } public httpservletrequest gethttpservletrequest() { return (httpservletrequest)facescontext.getcurrentinstance().getexternalcontext().getrequest(); } public httpservletresponse gethttpservletrespose() { return (httpservletresponse)facescontext.getcurrentinstance().getexternalcontext().getresponse(); }
Comments
Post a Comment