howto reproduce:
$> svn co http://svn.apache.org/repos/asf/incubator/openwebbeans/trunk openwebbeans
$> cd openwebbeans
$> mvn clean install
$> cd samples/guess
$> mvn -Pjetty clean package jetty:run
then browse http://localhost:8080/guess
the code involved:
public class WebBeansConfigurationListener implements ServletContextListener, ServletRequestListener, HttpSessionListener {
public void requestInitialized(ServletRequestEvent event)
{
this.lifeCycle.requestStarted(event);
}
...
public final class WebBeansLifeCycle {
public void requestStarted(ServletRequestEvent event)
{
ContextFactory.initRequestContext((HttpServletRequest) event.getServletRequest());
}
...
public final class ContextFactory {
public static void initRequestContext(HttpServletRequest request)
{
requestContext.set(new RequestContext());// set thread local
requestContext.get().setActive(true);
if (request != null)
{
HttpSession session = request.getSession(); <-- kawumm
initSessionContext(session);
initApplicationContext(request.getSession().getServletContext());
}
}
...
txs in advance,
strub
from struberg@apache.org