public void setMaxAge(int maxAge) { if (ctx.isContextInitializedCalled()) { String msg = MessageFormat.format(rb.getString(LogFacade.SESSION_COOKIE_CONFIG_ALREADY_INIT), new Object[] {"maxAge", ctx.getName()}); throw new IllegalStateException(msg); } this.maxAge = maxAge; }
/** * @param domain the cookie domain to use * * @throws IllegalStateException if the <tt>ServletContext</tt> * from which this <tt>SessionCookieConfig</tt> was acquired has * already been initialized */ public void setDomain(String domain) { if (ctx.isContextInitializedCalled()) { String msg = MessageFormat.format(rb.getString(LogFacade.SESSION_COOKIE_CONFIG_ALREADY_INIT), new Object[] {"dnmain", ctx.getName()}); throw new IllegalStateException(msg); } this.domain = domain; }
/** * @param comment the cookie comment to use * * @throws IllegalStateException if the <tt>ServletContext</tt> * from which this <tt>SessionCookieConfig</tt> was acquired has * already been initialized */ public void setComment(String comment) { if (ctx.isContextInitializedCalled()) { String msg = MessageFormat.format(rb.getString(LogFacade.SESSION_COOKIE_CONFIG_ALREADY_INIT), new Object[] {"comment", ctx.getName()}); throw new IllegalStateException(msg); } this.comment = comment; }
/** * @param path the cookie path to use * * @throws IllegalStateException if the <tt>ServletContext</tt> * from which this <tt>SessionCookieConfig</tt> was acquired has * already been initialized */ public void setPath(String path) { if (ctx.isContextInitializedCalled()) { String msg = MessageFormat.format(rb.getString(LogFacade.SESSION_COOKIE_CONFIG_ALREADY_INIT), new Object[] {"path", ctx.getName()}); throw new IllegalStateException(msg); } this.path = path; }
/** * @param httpOnly true if the session tracking cookies created * on behalf of the <tt>ServletContext</tt> from which this * <tt>SessionCookieConfig</tt> was acquired shall be marked as * <i>HttpOnly</i>, false otherwise * * @throws IllegalStateException if the <tt>ServletContext</tt> * from which this <tt>SessionCookieConfig</tt> was acquired has * already been initialized */ public void setHttpOnly(boolean httpOnly) { if (ctx.isContextInitializedCalled()) { String msg = MessageFormat.format(rb.getString(LogFacade.SESSION_COOKIE_CONFIG_ALREADY_INIT), new Object[] {"httpOnly", ctx.getName()}); throw new IllegalStateException(msg); } this.httpOnly = httpOnly; }
/** * @param secure true if the session tracking cookies created on * behalf of the <tt>ServletContext</tt> from which this * <tt>SessionCookieConfig</tt> was acquired shall be marked as * <i>secure</i> even if the request that initiated the corresponding * session is using plain HTTP instead of HTTPS, and false if they * shall be marked as <i>secure</i> only if the request that initiated * the corresponding session was also secure * * @throws IllegalStateException if the <tt>ServletContext</tt> * from which this <tt>SessionCookieConfig</tt> was acquired has * already been initialized */ public void setSecure(boolean secure) { if (ctx.isContextInitializedCalled()) { String msg = MessageFormat.format(rb.getString(LogFacade.SESSION_COOKIE_CONFIG_ALREADY_INIT), new Object[] {"secure", ctx.getName()}); throw new IllegalStateException(msg); } this.secure = secure; }
public void setAsyncSupported(boolean isAsyncSupported) { if (ctx.isContextInitializedCalled()) { String msg = MessageFormat.format(rb.getString(LogFacade.DYNAMIC_SERVLET_REGISTRATION_ALREADY_INIT), new Object[] {"load-on-startup", wrapper.getName(), ctx.getName()}); throw new IllegalStateException(msg); } wrapper.setIsAsyncSupported(isAsyncSupported); }
public void setRunAsRole(String roleName) { if (ctx.isContextInitializedCalled()) { String msg = MessageFormat.format(rb.getString(LogFacade.DYNAMIC_SERVLET_REGISTRATION_ALREADY_INIT), new Object[] {"run-as", wrapper.getName(), ctx.getName()}); throw new IllegalStateException(msg); } wrapper.setRunAs(roleName); }
/** * @param name the cookie name to use * * @throws IllegalStateException if the <tt>ServletContext</tt> * from which this <tt>SessionCookieConfig</tt> was acquired has * already been initialized */ public void setName(String name) { if (ctx.isContextInitializedCalled()) { String msg = MessageFormat.format(rb.getString(LogFacade.SESSION_COOKIE_CONFIG_ALREADY_INIT), new Object[] {"name", ctx.getName()}); throw new IllegalStateException(msg); } this.name = name; ctx.setSessionCookieName(name); }
public void setLoadOnStartup(int loadOnStartup) { if (ctx.isContextInitializedCalled()) { String msg = MessageFormat.format(rb.getString(LogFacade.DYNAMIC_SERVLET_REGISTRATION_ALREADY_INIT), new Object[] {"load-on-startup", wrapper.getName(), ctx.getName()}); throw new IllegalStateException(msg); } wrapper.setLoadOnStartup(loadOnStartup); }
public void setAsyncSupported(boolean isAsyncSupported) { if (ctx.isContextInitializedCalled()) { String msg = MessageFormat.format(rb.getString(LogFacade.DYNAMIC_FILTER_REGISTRATION_ALREADY_INIT), new Object[] {"async-supported", filterDef.getFilterName(), ctx.getName()}); throw new IllegalStateException(msg); } filterDef.setIsAsyncSupported(isAsyncSupported); } }
public boolean setInitParameter(String name, String value) { if (ctx.isContextInitializedCalled()) { String msg = MessageFormat.format(rb.getString(LogFacade.FILTER_REGISTRATION_ALREADY_INIT), new Object[] {"init parameter", filterDef.getFilterName(), ctx.getName()}); throw new IllegalStateException(msg); } return filterDef.setInitParameter(name, value, false); }
public boolean setInitParameter(String name, String value) { if (ctx.isContextInitializedCalled()) { String msg = MessageFormat.format(rb.getString(LogFacade.SERVLET_REGISTRATION_ALREADY_INIT), new Object[] {"init parameter", wrapper.getName(), ctx.getName()}); throw new IllegalStateException(msg); } return wrapper.setInitParameter(name, value, false); }
public Set<String> addMapping(String... urlPatterns) { if (ctx.isContextInitializedCalled()) { String msg = MessageFormat.format(rb.getString(LogFacade.SERVLET_REGISTRATION_ALREADY_INIT), new Object[] {"mapping", wrapper.getName(), ctx.getName()}); throw new IllegalStateException(msg); } if (urlPatterns == null || urlPatterns.length == 0) { String msg = MessageFormat.format(rb.getString(LogFacade.SERVLET_REGISTRATION_MAPPING_URL_PATTERNS_EXCEPTION), new Object[] {wrapper.getName(), ctx.getName()}); throw new IllegalArgumentException(msg); } return ctx.addServletMapping(wrapper.getName(), urlPatterns); }
public void addMappingForServletNames( EnumSet<DispatcherType> dispatcherTypes, boolean isMatchAfter, String... servletNames) { if (ctx.isContextInitializedCalled()) { String msg = MessageFormat.format(rb.getString(LogFacade.FILTER_REGISTRATION_ALREADY_INIT), new Object[] {"servlet-name mapping", filterDef.getFilterName(), ctx.getName()}); throw new IllegalStateException(msg); } if ((servletNames==null) || (servletNames.length==0)) { String msg = MessageFormat.format(rb.getString(LogFacade.FILTER_REGISTRATION_MAPPING_SERVLET_NAME_EXCEPTION), new Object[] {filterDef.getFilterName(), ctx.getName()}); throw new IllegalArgumentException(msg); } for (String servletName : servletNames) { FilterMap fmap = new FilterMap(); fmap.setFilterName(filterDef.getFilterName()); fmap.setServletName(servletName); fmap.setDispatcherTypes(dispatcherTypes); ctx.addFilterMap(fmap, isMatchAfter); } }
public void addMappingForUrlPatterns( EnumSet<DispatcherType> dispatcherTypes, boolean isMatchAfter, String... urlPatterns) { if (ctx.isContextInitializedCalled()) { String msg = MessageFormat.format(rb.getString(LogFacade.FILTER_REGISTRATION_ALREADY_INIT), new Object[] {"url-pattern mapping", filterDef.getFilterName(), ctx.getName()}); throw new IllegalStateException(msg); } if ((urlPatterns==null) || (urlPatterns.length==0)) { String msg = MessageFormat.format(rb.getString(LogFacade.FILTER_REGISTRATION_MAPPING_URL_PATTERNS_EXCEPTION), new Object[] {filterDef.getFilterName(), ctx.getName()}); throw new IllegalArgumentException(msg); } for (String urlPattern : urlPatterns) { FilterMap fmap = new FilterMap(); fmap.setFilterName(filterDef.getFilterName()); fmap.setURLPattern(urlPattern); fmap.setDispatcherTypes(dispatcherTypes); ctx.addFilterMap(fmap, isMatchAfter); } }
public void setMultipartConfig(MultipartConfigElement mpConfig) { if (ctx.isContextInitializedCalled()) { String msg = MessageFormat.format(rb.getString(LogFacade.DYNAMIC_SERVLET_REGISTRATION_ALREADY_INIT), new Object[] {"multipart-config", wrapper.getName(), ctx.getName()}); throw new IllegalStateException(msg); } wrapper.setMultipartLocation(mpConfig.getLocation()); wrapper.setMultipartMaxFileSize(mpConfig.getMaxFileSize()); wrapper.setMultipartMaxRequestSize(mpConfig.getMaxRequestSize()); wrapper.setMultipartFileSizeThreshold( mpConfig.getFileSizeThreshold()); }