Package javax.servlet

Examples of javax.servlet.ServletContext


     * @param width The total width of the progress bar.
     * @param height the total height of the progress bar, i.e. a single bar 100, but a double bar would be 200.
     * @return String the wrapped String
     */
    public static String getTaskPathOnClick(String path, String bundle, String name, HttpSession session, int width, int height) {
        ServletContext servletContext = session.getServletContext();
        Locale locale = (Locale) session.getAttribute(Globals.LOCALE_KEY);
        return getTaskPath(path, bundle, name, servletContext, locale, width, height, true);
    }
View Full Code Here


         log.info("Found BeanManager at java:app/BeanManager");
         return beanManager;
      }

      // Look for BeanManager in ServletContext
      ServletContext servletContext = ResteasyProviderFactory.getContextData(ServletContext.class);
      beanManager = (BeanManager) servletContext.getAttribute(BEAN_MANAGER_ATTRIBUTE_PREFIX + BeanManager.class.getName());
      if (beanManager != null)
      {
         log.debug("Found BeanManager in ServletContext");
         return beanManager;
      }

      // Look for BeanManager in ServletContext (the old attribute name for backwards compatibility)
      beanManager = (BeanManager) servletContext.getAttribute(BeanManager.class.getName());
      if (beanManager != null)
      {
         log.debug("Found BeanManager in ServletContext");
         return beanManager;
      }
View Full Code Here

   
    if (logger.isDebugEnabled())
      logger.debug("JSAPIServlet loaded");

    // make it possible to get to us for rescanning
    ServletContext servletContext = config .getServletContext();
    servletContext.setAttribute(getClass().getName(), this);
  }
View Full Code Here

  }

  public void scanResources(){

    ServletConfig config = getServletConfig();
    ServletContext servletContext = config .getServletContext();
    ResourceMethodRegistry registry = (ResourceMethodRegistry) servletContext
    .getAttribute(Registry.class.getName());
    ResteasyProviderFactory providerFactory =
      (ResteasyProviderFactory) servletContext.getAttribute(ResteasyProviderFactory.class.getName());

    String restPath = servletContext
    .getInitParameter("resteasy.servlet.mapping.prefix");

    service = new ServiceRegistry(null, registry, providerFactory, null);
    apiWriter = new JSAPIWriter(restPath);
  }
View Full Code Here

        } else if (definition.getType() == PropertyDefinition.TYPE_LIST) {
            List<Pair> listItemsList = new ArrayList<Pair>();
            if (!definition.getTypeMeta().startsWith("!")) {
                for (Iterator i = ((List) definition.getTypeMetaObject()).iterator(); i.hasNext();) {
                    TypeMetaListItem item = (TypeMetaListItem) i.next();
                    ServletContext context = CoreServlet.getServlet().getServletContext();
                    ModuleConfig moduleConfig = ModuleUtils.getInstance().getModuleConfig(request, context);
                    String mrKey = (item.getMessageResourcesKey() == null ? "properties" : item.getMessageResourcesKey())
                                    + moduleConfig.getPrefix();
                    MessageResources res = (MessageResources) context.getAttribute(mrKey);
                    String k = definition.getName() + ".value." + item.getValue();
                    String v = "";
                    if (res != null) {
                        v = res.getMessage((Locale) request.getSession().getAttribute(Globals.LOCALE_KEY), k);
                        if (v == null) {
View Full Code Here

   
    public void renderView(FreeMarkerView view, ViewContext viewContext) throws Exception{
        if (view == null){
            return;
        }
        ServletContext servletContext = viewContext.getServletContext();
        Configuration cfg = (Configuration)servletContext.getAttribute(FreeMarkerViewRenderer.FREEMARKER_CONFIG);
        if (cfg == null){
            cfg = new Configuration();
            cfg.setDefaultEncoding("UTF-8");
            initConfiguration(cfg, viewContext);
            servletContext.setAttribute(FreeMarkerViewRenderer.FREEMARKER_CONFIG, cfg);
        }
       
        HttpServletRequest request = viewContext.getRequest();
        HttpServletResponse response = viewContext.getResponse();
        String controllerPath = viewContext.getControllerPath();
View Full Code Here

  /* (non-Javadoc)
   * @see de.odysseus.calyxo.forms.FormsSupport#init(de.odysseus.calyxo.base.ModuleContext, de.odysseus.calyxo.forms.conf.FormsRootConfig)
   */
  protected void init(ModuleContext context, FormsRootConfig config, FormFactory factory) throws ConfigException {   
    super.init(context, config, factory);
    ServletContext servletContext = context.getServletContext();
    servlet = (ActionServlet)servletContext.getAttribute(Globals.ACTION_SERVLET_KEY);
  }
View Full Code Here

        if (definition.getType() == PropertyDefinition.TYPE_LIST) {
            List<Pair> listItemsList = new ArrayList<Pair>();
            if (!definition.getTypeMeta().startsWith("!")) {
                for (Iterator i = ((List) definition.getTypeMetaObject()).iterator(); i.hasNext();) {
                    TypeMetaListItem item = (TypeMetaListItem) i.next();
                    ServletContext context = CoreServlet.getServlet().getServletContext();
                    ModuleConfig moduleConfig = ModuleUtils.getInstance().getModuleConfig(request, context);
                    String mrKey = (item.getMessageResourcesKey() == null ? "properties" : item.getMessageResourcesKey())
                                    + moduleConfig.getPrefix();
                    MessageResources res = (MessageResources) context.getAttribute(mrKey);
                    String k = definition.getName() + ".value." + item.getValue();
                    String v = "";
                    if (res != null) {
                        v = res.getMessage((Locale) request.getSession().getAttribute(Globals.LOCALE_KEY), k);
                        if (v == null) {
View Full Code Here

     *
     * @see com.adito.properties.PairListDataSource#getValues(javax.servlet.http.HttpServletRequest)
     */
    public List getValues(HttpServletRequest request) {
        List<Pair> l = new ArrayList<Pair>();
        ServletContext context = CoreServlet.getServlet().getServletContext();
        for (UserDatabaseDefinition def : UserDatabaseManager.getInstance().getUserDatabaseDefinitions()) {
            l.add(new Pair(def.getName(),
                            ((MessageResources) context.getAttribute(def.getMessageResourcesKey()
                                            + ModuleUtils.getInstance().getModuleConfig(request, context).getPrefix())).getMessage("security.userDatabase.value."
                                            + def.getName())));
        }
        return l;
    }
View Full Code Here

  private static final long serialVersionUID = 1L;

  protected void doGet(HttpServletRequest req, HttpServletResponse resp)
      throws ServletException, IOException {
    // Retrieves the servlet context.
    ServletContext context = getServletContext();
    // Retrieves the scheduler.
    Scheduler scheduler = (Scheduler) context
        .getAttribute(Constants.SCHEDULER);
    // Retrieves the executors.
    TaskExecutor[] executors = scheduler.getExecutingTasks();
    // Registers the executors in the request.
    req.setAttribute("executors", executors);
View Full Code Here

TOP

Related Classes of javax.servlet.ServletContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.