myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "todor.dimitrov" <todor.dimit...@me.com>
Subject "ExternalContext#responseSendError" does not interrupt JSF Lifecycle
Date Fri, 25 Jan 2013 11:08:15 GMT
Hi,

I'm using the "ExternalContext#responseSendError" inside a Bean method like this:

	public void test() {
		// some logic

		final FacesContext facesContext = FacesContext.getCurrentInstance();
		final ExternalContext externalContext = facesContext
				.getExternalContext();
		try {
			externalContext.responseSendError(HttpServletResponse.SC_NOT_FOUND, null);
		} catch (IOException ex) {
			throw new RuntimeException(ex);
		}
		facesContext.responseComplete();
	}

The JSF Lifecycle is not interrupted such that validation and rendering for the current view
are still taking place. Is this the expected behavior? Is there a way to just abandon processing
altogether as soon as "ExternalContext#responseSendError" is called?


Regards,

Todor




Mime
View raw message