jsf 2 - How to throw 404 from bean in jsf -
jsf 2 - How to throw 404 from bean in jsf -
i need throw 404 , take visitor specific page. trying next code:
facescontext facescontext = facescontext.getcurrentinstance(); externalcontext externalcontext = facescontext.getexternalcontext(); externalcontext.setresponsestatus(httpservletresponse.sc_not_found); externalcontext.setresponseheader(common.location, "browse_by_category.xhtml?category=category_all"); facescontext.responsecomplete();
404 happens redirection browse_by_category.xhtml page not happen. help appreciated.
according comment please seek this:
facescontext facescontext = facescontext.getcurrentinstance(); externalcontext externalcontext = facescontext.getexternalcontext(); externalcontext.setresponsestatus(httpservletresponse.sc_not_found); //externalcontext.setresponseheader(common.location, "browse_by_category.xhtml?category=category_all"); externalcontext.dispatch("browse_by_category.xhtml"); facescontext.responsecomplete();
jsf-2 http-response-codes
Comments
Post a Comment