Package javax.servlet

Examples of javax.servlet.ServletContext.log()


                numSuccessful++;
            }
        }

        if (context != null)
            context.log ("ServiceManager: Services initialized (" + numSuccessful + "/" + numAll + " successful).");
        if (numSuccessful!=numAll)
        {
            throw new Exception("ServiceManager: Services initialized (" + numSuccessful + "/" + numAll + " successful).");
        }
    }
View Full Code Here


               service.postInit(aConfig);
           }
           catch (Exception exc)
           {
               if (context != null)
                   context.log ("ServiceManager: Service couldn't be started (postInit) after init..", exc);
           }
       }

     }
View Full Code Here

                service.destroy (aConfig);
            }
            catch (Exception exc)
            {
                if (context != null)
                    context.log ("ServiceManager: Service couldn't be destroyed.", exc);
            }
        }

        cServicesList.clear();
        cServicesMap.clear();
View Full Code Here

            initNode();
       
        } catch (Throwable e) {
            e.printStackTrace();
            servletContext.log("exception initializing SCA node", e);
        }
    }

    public void contextDestroyed(ServletContextEvent event) {
        if (node != null) {
View Full Code Here

    public void testGetLogs()
    {
        String message = "some test log";
        ServletContext context = config.getServletContext();

        context.log(message);

        Vector logs = ((ServletContextWrapper) context).getLogs();
        assertEquals("Found more than one log message", logs.size(), 1);
        assertTrue("Cannot find expected log message : [" + message + "]",
            logs.contains("some test log"));
View Full Code Here

    if (rs != null) {
      try {
        Manifest m = new Manifest(rs);
        GoobiVersion.setupFromManifest(m);
      } catch (IOException e) {
        context.log(e.getMessage());
      }
    }    
  }

  public void contextDestroyed(ServletContextEvent sce) {
View Full Code Here

                    final String className = ClassLoaderUtil.resourceToClass(resource);
                    try (InputStream is = cl.getResourceAsStream(resource)) {
                        if (AnnotationUtil.hasClassAnnotation(WebActor.class, is))
                            registerWebActor(sc, cl.loadClass(className));
                    } catch (IOException | ClassNotFoundException e) {
                        sc.log("Exception while scanning class " + className + " for WebActor annotation", e);
                        throw new RuntimeException(e);
                    }
                }
            });
//            final ClassPath classpath = ClassPath.from(cl);
View Full Code Here

//                } catch (IOException e) {
//                    sc.log("IOException while scanning class " + ci.getName() + " for WebActor annotation", e);
//                }
//            }
        } catch (IOException e) {
            sc.log("IOException while scanning classes for WebActor annotation", e);
        }
    }

    public static void registerWebActor(ServletContext sc, Class<?> webActorClass) {
        final WebActor waAnn = webActorClass.getAnnotation(WebActor.class);
View Full Code Here

        ClassLoader cl = Thread.currentThread().getContextClassLoader();
        if (locale != null) {
            _bundle = _localeManager.getBundle(_baseName,locale,cl);
            if (_debug) {
                ServletContext sc = pageContext.getServletContext();
                sc.log("i18n:bundle tag debug: found locale " + locale);
            }
        }

        // attempt to load the bundle and compute the locale by looping through
        // the browser's preferred locales; cache the final locale for future use
View Full Code Here

            while (localeEnumerator.hasMoreElements()) {
                locale = (Locale)localeEnumerator.nextElement();

                if (_debug) {
                    ServletContext sc = pageContext.getServletContext();
                    sc.log("i18n:bundle tag debug: enumerating locale = " + locale);
                }

                // get a bundle and see whether it has a good locale
                ResourceBundle test = _localeManager.getBundle(_baseName,locale,cl);
                String language = test.getLocale().getLanguage();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.