- Add the Codota plugin to your IDE and get smart completions
private void myMethod () {OutputStreamWriter o =
OutputStream out;new OutputStreamWriter(out)
OutputStream out;String charsetName;new OutputStreamWriter(out, charsetName)
HttpURLConnection connection;new OutputStreamWriter(connection.getOutputStream())
- Smart code suggestions by Codota
}
/** * Get the session, create equals false; * @return http session or null if no such session exists */ protected HttpSession getSessionIfExists() { return SessionHolder.getSessionIfExists(); }
@Override protected void setSessionAttribute(HttpServletRequest request, String name, Object value, boolean create) { if (create || SessionHolder.getSessionIfExists() != null) { getSessionFromRequest(request, true).setAttribute(name, value); } }
@Override protected Object getSessionAttribute(HttpServletRequest request, String name, boolean create) { if (create || SessionHolder.getSessionIfExists() != null) { return getSessionFromRequest(request, true).getAttribute(name); } else { return null; } }
private HttpSession obtainHttpSession() { HttpSession session = SessionHolder.getSessionIfExists(); if (session == null) { throw ServletLogger.LOG.cannotInjectObjectOutsideOfServletRequest(HttpSession.class.getSimpleName(), null); } return session; }