views:

63

answers:

1

When configuring filters, I can pass some values to a filter as initial parameters in web.xml and obtain those values in Filter via FilterConfig. How can I configure some initial parameters in web.xml for HttpSessionListener? If this is not possible, what are alternatives?

+4  A: 

Like this:

public class MyListener implements HttpSessionListener {

   public void sessionCreated(HttpSessionEvent event) {
      String value = event.getSession().getServletContext().getInitParameter(paramName);
   }
}
skaffman