Package javax.servlet

Examples of javax.servlet.ServletContext.log()


            if ( config != null )
            {
                ServletContext context = config.getServletContext();
                if ( context != null )
                {
                    context.log( message );
                    return;
                }
            }

            System.err.println( message );
View Full Code Here


            if ( config != null )
            {
                ServletContext context = config.getServletContext();
                if ( context != null )
                {
                    context.log( message, t );
                    return;
                }
            }

            System.err.println( message );
View Full Code Here

            if ( config != null )
            {
                ServletContext context = config.getServletContext();
                if ( context != null )
                {
                    context.log( message );
                    return;
                }
            }

            System.err.println( message );
View Full Code Here

            if ( config != null )
            {
                ServletContext context = config.getServletContext();
                if ( context != null )
                {
                    context.log( message, t );
                    return;
                }
            }

            System.err.println( message );
View Full Code Here

    public void requestInitialized(ServletRequestEvent sre) {
        Map<String, String[]> paramMap = sre.getServletRequest().getParameterMap();
        ServletContext servletContext = sre.getServletContext();

        // to see log messages at runtime, check the terminal window where you started WildFly.
        servletContext.log("ParameterDumpingRequestListener: request has been initialized. It has " + paramMap.size()
                + " parameters:");
        for (Map.Entry<String, String[]> entry : paramMap.entrySet()) {
            for (String val : entry.getValue()) {
                servletContext.log("  " + entry.getKey() + "=" + val);
            }
View Full Code Here

        // to see log messages at runtime, check the terminal window where you started WildFly.
        servletContext.log("ParameterDumpingRequestListener: request has been initialized. It has " + paramMap.size()
                + " parameters:");
        for (Map.Entry<String, String[]> entry : paramMap.entrySet()) {
            for (String val : entry.getValue()) {
                servletContext.log("  " + entry.getKey() + "=" + val);
            }
        }
    }

    @Override
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 + "]",
View Full Code Here

        String name = subst.replace(context.getInitParameter(LOG4J_CONTEXT_NAME));
        if (name == null) {
            name = context.getServletContextName();
        }
        if (name == null && locn == null) {
            context.log("No Log4j context configuration provided");
            return;
        }
        context.setAttribute(LOG4J_CONTEXT_ATTRIBUTE, Configurator.initialize(name, getClassLoader(context), locn));
    }
View Full Code Here

        try
        {
            File propertiesFile = new File(context.getRealPath("WEB-INF/classes/properties/database.properties"));
            if (propertiesFile.exists())
            {
              context.log("LocalHsqldbConfigurator: database.properties already exists");
              return;
            }
            String dbPath = context.getRealPath("/WEB-INF/db/jpetstore.script");
            FileWriter output = new FileWriter(propertiesFile);
            output.write("driver=org.hsqldb.jdbcDriver\n");
View Full Code Here

            output.write("driver=org.hsqldb.jdbcDriver\n");
            output.write("url=jdbc:hsqldb:"+dbPath.substring(0,dbPath.length()-(".script".length())).replace('\\','/')+"\n");
            output.write("username=sa\n");
            output.write("password=\n");
            output.close();
            context.log("LocalHsqldbConfigurator: database.properties created");
        }
        catch (IOException e)
        {
            context.log("LocalHsqldbConfigurator: failed to create database.properties",e);
        }
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.