public FacesRequest withViewId(String viewId) { if (connection.isStarted() || connection.isFinished()) { throw new IllegalStateException(); } this.viewId = viewId; return this; }
public FacesRequest withViewId(String viewId) { if (connection.isStarted() || connection.isFinished()) { throw new IllegalStateException(); } this.viewId = viewId; return this; }
public FacesRequest finish() { if (!connection.isStarted() || connection.isFinished()) { throw new IllegalStateException(); } connection.finish(); return this; }
public FacesRequest finish() { if (!connection.isStarted() || connection.isFinished()) { throw new IllegalStateException(); } connection.finish(); return this; }
public void release() { if (null != facesContext) { facesContext.release(); facesContext = null; } if (null != connection) { if (!connection.isFinished()) { connection.finish(); } connection = null; } requests.remove(this); }
public void release() { if (null != facesContext) { facesContext.release(); facesContext = null; } if (null != connection) { if (!connection.isFinished()) { connection.finish(); } connection = null; } requests.remove(this); }
public byte[] execute() { if (connection.isStarted() || connection.isFinished()) { throw new IllegalStateException(); } connection.execute(); return connection.getResponseBody(); }
public byte[] execute() { if (connection.isStarted() || connection.isFinished()) { throw new IllegalStateException(); } connection.execute(); return connection.getResponseBody(); }
public FacesRequest submit() throws MalformedURLException, FacesException { if (!connection.isFinished()) { throw new IllegalStateException(); } // Extract VIEW_STATE value. Map<String, String> fields = getHiddenFields(connection.getContentAsString()); if (!fields.containsKey(ResponseStateManager.VIEW_STATE_PARAM)) { throw new FacesException("No view state field in response"); } FacesRequest facesRequest = createFacesRequest(connection.getRequest().getRequestURL().toString()) .withViewId(viewId); facesRequest.connection.setRequestMethod(HttpMethod.POST); for (Map.Entry<String, String> entry : fields.entrySet()) { facesRequest.withParameter(entry.getKey(), entry.getValue()); } return facesRequest; }
public FacesRequest submit() throws MalformedURLException, FacesException { if (!connection.isFinished()) { throw new IllegalStateException(); } // Extract VIEW_STATE value. Map<String, String> fields = getHiddenFields(connection.getContentAsString()); if (!fields.containsKey(ResponseStateManager.VIEW_STATE_PARAM)) { throw new FacesException("No view state field in response"); } FacesRequest facesRequest = createFacesRequest(connection.getRequest().getRequestURL().toString()) .withViewId(viewId); facesRequest.connection.setRequestMethod(HttpMethod.POST); for (Map.Entry<String, String> entry : fields.entrySet()) { facesRequest.withParameter(entry.getKey(), entry.getValue()); } return facesRequest; }
/** * Virtual server instance cleanup. * @throws java.lang.Exception */ @Override @After public void tearDown() throws Exception { if (null != facesContext) { facesContext.release(); facesContext = null; } if (null != connection) { if (!connection.isFinished()) { connection.finish(); } connection = null; } facesServer.destroy(); Thread.currentThread().setContextClassLoader(contextClassLoader); facesServer = null; application = null; lifecycle = null; }
/** * Virtual server instance cleanup. * @throws java.lang.Exception */ @Override @After public void tearDown() throws Exception { if (null != facesContext) { facesContext.release(); facesContext = null; } if (null != connection) { if (!connection.isFinished()) { connection.finish(); } connection = null; } facesServer.destroy(); Thread.currentThread().setContextClassLoader(contextClassLoader); facesServer = null; application = null; lifecycle = null; }
public FacesRequest start() { if (connection.isStarted() || connection.isFinished()) { throw new IllegalStateException(); } connection.start(); FacesContextFactory facesContextFactory = (FacesContextFactory) FactoryFinder .getFactory(FactoryFinder.FACES_CONTEXT_FACTORY); facesContext = facesContextFactory.getFacesContext(facesServer.getContext(), connection.getRequest(), connection.getResponse(), lifecycle); if (null != viewId) { facesContext.setViewRoot(application.getViewHandler().createView(facesContext, viewId)); } return this; }
public FacesRequest start() { if (connection.isStarted() || connection.isFinished()) { throw new IllegalStateException(); } connection.start(); FacesContextFactory facesContextFactory = (FacesContextFactory) FactoryFinder .getFactory(FactoryFinder.FACES_CONTEXT_FACTORY); facesContext = facesContextFactory.getFacesContext(facesServer.getContext(), connection.getRequest(), connection.getResponse(), lifecycle); if (null != viewId) { facesContext.setViewRoot(application.getViewHandler().createView(facesContext, viewId)); } return this; }