private void setCookieHeader() { if (request == null) { return; } final HttpSession session = request.getSession(false); if (session == null) { return; } setHeader(HttpRequest.HEADER_SET_COOKIE, SessionManager.EJBSESSIONID + '=' + session.getId() + "; Path=/"); }
public HttpListener addWrappedHttpListener(final HttpListener httpListener, final ClassLoader classLoader, final String regex) { final HttpListener listener = new ClassLoaderHttpListener(httpListener, classLoader); registry.addHttpListener(listener, regex); return listener; }
@Override public AsyncContext startAsync(final ServletRequest servletRequest, final ServletResponse servletResponse) throws IllegalStateException { return new AsynContextWrapper(super.startAsync(servletRequest, servletResponse), servletRequest, webBeansContext); } }
/** * resets the data to be sent to the browser with the response code and response * string * * @param code the code to be sent to the browser * @param responseString the response string to be sent to the browser */ public void reset(final int code, final String responseString) { setCode(code); setResponseString(responseString); initBody(); }
/** * closes the message sent to the browser */ private void closeMessage() { setContentLengthHeader(); setCookieHeader(); }
@Override public void removeWsContainer(final String path, final String moduleId) { registry.removeHttpListener(path); } }
/** * gets the content type that will be sent to the browser * * @return the content type (i.e. "text/html") */ public String getContentType() { return getHeader("Content-Type"); }
/** This could be improved at some day in the future * to also include a stack trace of the exceptions * @param message the error message to be sent * @return the HttpResponseImpl that this error belongs to */ protected static HttpResponseImpl createError(String message){ return createError(message, null); }
@Override public AsyncContext startAsync() throws IllegalStateException { return new AsynContextWrapper(super.startAsync(), getRequest(), webBeansContext); }
@Override public String getIP() { return httpServer.getIP(); } }
/** * resets the data to be sent to the browser */ public void reset() { initBody(); }
/** * {@inheritDoc} */ @Override public void sessionDestroyed(final HttpSessionEvent event) { ensureRequestScope(); }
public HttpSessionImpl(final String contextPath, final long timeout) { this.timeout = timeout; if (contextPath == null) { return; } this.listeners = LightweightWebAppBuilderListenerExtractor.findByTypeForContext(contextPath, HttpSessionListener.class); }
@Override public void contextDestroyed(final ServletContextEvent servletContextEvent) { destroyFakedRequest(); } }
/** * resets the data to be sent to the browser with the response code and response * string * * @param code the code to be sent to the browser * @param responseString the response string to be sent to the browser */ public void reset(final int code, final String responseString) { setCode(code); setResponseString(responseString); initBody(); }
public HttpListener addWrappedHttpListener(HttpListener httpListener, ClassLoader classLoader, String regex) { HttpListener listener = new ClassLoaderHttpListener(httpListener, classLoader); registry.addHttpListener(listener, regex); return listener; }
/** * gets the content type that will be sent to the browser * * @return the content type (i.e. "text/html") */ @Override public String getContentType() { return getHeader("Content-Type"); }
/** * This could be improved at some day in the future * to also include a stack trace of the exceptions * * @param message the error message to be sent * @return the HttpResponseImpl that this error belongs to */ @SuppressWarnings("unused") protected static HttpResponseImpl createError(final String message) { return createError(message, null); }
@Override public void contextDestroyed(final ServletContextEvent servletContextEvent) { ensureRequestScope(); } }
/** resets the data to be sent to the browser with the response code and response * string * @param code the code to be sent to the browser * @param responseString the response string to be sent to the browser */ public void reset(int code, String responseString){ setCode(code); setResponseString(responseString); initBody(); }