Permalink
Browse files

Adding simple servlet listener example

  • Loading branch information...
1 parent 71707b8 commit 4ebb12d759e50e47691ff62489647f18aee9d6fc @kylape committed Nov 15, 2012
@@ -0,0 +1,3 @@
+###Simple `ServletContextListener`
+
+This is pretty much as basic as it gets. Prints out "Context initilized!" upon deployment and that's it.
@@ -0,0 +1,26 @@
+/*
+ * To the extent possible under law, Red Hat, Inc. has dedicated all copyright
+ * to this software to the public domain worldwide, pursuant to the CC0 Public
+ * Domain Dedication. This software is distributed without any warranty. See
+ * <http://creativecommons.org/publicdomain/zero/1.0/>.
+ */
+package com.redhat.gss.servlet;
+
+import javax.servlet.ServletContextListener;
+import javax.servlet.ServletContextEvent;
+
+import org.jboss.logging.Logger;
+
+public class SimpleListener implements ServletContextListener
+{
+ private Logger log = Logger.getLogger(this.getClass().getName());
+
+ public void contextInitialized(ServletContextEvent event)
+ {
+ log.info("Context initialized!");
+ }
+
+ public void contextDestroyed(ServletContextEvent event)
+ {
+ }
+}
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ To the extent possible under law, Red Hat, Inc. has dedicated all copyright
+ to this software to the public domain worldwide, pursuant to the CC0 Public
+ Domain Dedication. This software is distributed without any warranty. See
+ <http://creativecommons.org/publicdomain/zero/1.0/>.
+-->
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">
+ <listener>
+ <listener-class>com.redhat.gss.servlet.SimpleListener</listener-class>
+ </listener>
+</web-app>
Oops, something went wrong.

0 comments on commit 4ebb12d

Please sign in to comment.