List of usage examples for javax.servlet ServletContext setAttribute
public void setAttribute(String name, Object object);
From source file:edu.cornell.mannlib.vitro.webapp.auth.policy.bean.PropertyRestrictionPolicyHelper.java
public static void setBean(ServletContext ctx, PropertyRestrictionPolicyHelper bean) { if (bean == null) { throw new NullPointerException("bean may not be null."); }//from w ww. jav a 2s . co m ctx.setAttribute(ATTRIBUTE_NAME, bean); }
From source file:org.glite.security.voms.admin.core.VOMSService.java
private static void setupGlobalApplicationObjects(ServletContext ctxt) { AUP aup = DAOFactory.instance().getAUPDAO().getVOAUP(); ctxt.setAttribute("registrationEnabled", VOMSConfiguration.instance() .getBoolean(VOMSConfigurationConstants.REGISTRATION_SERVICE_ENABLED, true)); ctxt.setAttribute("readOnlyPI", VOMSConfiguration.instance() .getBoolean(VOMSConfigurationConstants.VOMS_INTERNAL_RO_PERSONAL_INFORMATION, false)); ctxt.setAttribute("readOnlyMembershipExpiration", VOMSConfiguration.instance() .getBoolean(VOMSConfigurationConstants.VOMS_INTERNAL_RO_MEMBERSHIP_EXPIRATION_DATE, false)); ctxt.setAttribute("disableMembershipEndTime", VOMSConfiguration.instance() .getBoolean(VOMSConfigurationConstants.DISABLE_MEMBERSHIP_END_TIME, false)); ctxt.setAttribute("defaultAUP", aup); ctxt.setAttribute("orgdbEnabled", VOMSConfiguration.instance().getRegistrationType() .equals(OrgDBConfigurator.ORGDB_REGISTRATION_TYPE)); }
From source file:edu.cornell.mannlib.vitro.webapp.startup.StartupStatus.java
public static StartupStatus getBean(ServletContext ctx) { StartupStatus ss;/*from w ww . j a v a2 s. c om*/ Object o = ctx.getAttribute(ATTRIBUTE_NAME); if (o instanceof StartupStatus) { ss = (StartupStatus) o; } else { ss = new StartupStatus(); ctx.setAttribute(ATTRIBUTE_NAME, ss); } return ss; }
From source file:org.hdiv.util.HDIVUtil.java
/** * Set the <code>IApplication</code> in <code>ServletContext</code> * //from www . j av a2 s . c o m * @param newApplication * @param servletContext */ public static void setApplication(IApplication newApplication, ServletContext servletContext) { servletContext.setAttribute(APPLICATION_SERVLETCONTEXT_KEY, newApplication); }
From source file:org.hdiv.util.HDIVUtil.java
/** * Set the <code>HDIVConfig</code> object * //from w w w . j a v a 2 s .c om * @param hdivConfig * @param servletContext */ public static void setHDIVConfig(HDIVConfig hdivConfig, ServletContext servletContext) { servletContext.setAttribute(HDIVCONFIG_SERVLETCONTEXT_KEY, hdivConfig); }
From source file:org.hdiv.util.HDIVUtil.java
/** * Set the <code>ISession</code> instance. * //from www. j av a 2 s . c om * @param session * @param servletContext */ public static void setISession(ISession session, ServletContext servletContext) { servletContext.setAttribute(ISESSION_SERVLETCONTEXT_KEY, session); }
From source file:org.hdiv.util.HDIVUtil.java
/** * Set the <code>LinkUrlProcessor</code> instance. * /*from w ww . j a v a 2s. c om*/ * @param urlProcessor * {@link LinkUrlProcessor} instance * @param servletContext * {@link ServletContext} instance */ public static void setLinkUrlProcessor(LinkUrlProcessor urlProcessor, ServletContext servletContext) { servletContext.setAttribute(LINKURLPROCESSOR_SERVLETCONTEXT_KEY, urlProcessor); }
From source file:org.hdiv.util.HDIVUtil.java
/** * Set the <code>FormUrlProcessor</code> instance. * /* ww w . j a v a2 s.c o m*/ * @param urlProcessor * {@link FormUrlProcessor} instance * @param servletContext * {@link ServletContext} instance */ public static void setFormUrlProcessor(FormUrlProcessor urlProcessor, ServletContext servletContext) { servletContext.setAttribute(FORMURLPROCESSOR_SERVLETCONTEXT_KEY, urlProcessor); }
From source file:org.hdiv.util.HDIVUtil.java
/** * Set the {@link MessageSource} instance. * //www .jav a2 s . c o m * @param msgSource * @param servletContext */ public static void setMessageSource(MessageSource msgSource, ServletContext servletContext) { servletContext.setAttribute(MESSAGESOURCE_SERVLETCONTEXT_KEY, msgSource); }
From source file:edu.cornell.mannlib.vitro.webapp.beans.SelfEditingConfiguration.java
/** * Get the bean from the context. If there no bean, create one on the fly * and store it in the context./*from ww w.ja v a 2s . c o m*/ * * Never returns null. */ public static SelfEditingConfiguration getBean(ServletContext ctx) { Object attr = ctx.getAttribute(BEAN_ATTRIBUTE); if (attr instanceof SelfEditingConfiguration) { log.debug("Found a bean: " + attr); return (SelfEditingConfiguration) attr; } SelfEditingConfiguration bean = buildBean(ctx); log.debug("Created a bean: " + bean); ctx.setAttribute(BEAN_ATTRIBUTE, bean); return bean; }