Re: Context path from ServletContextListener

2011-05-25 Thread Mateu Yabar
Sorry, I don't see how I did not see it: arg0.getServletContext().getContextPath() On 25 May 2011 10:53, Mateu Yabar wrote: > Hi to all, > > I've created a ServletContextListener, which needs to use get the current > context path (as defined in web.

Context path from ServletContextListener

2011-05-25 Thread Mateu Yabar
Hi to all, I've created a ServletContextListener, which needs to use get the current context path (as defined in web.xml): public class UpdateExecutionStartContextListener implements javax.servlet.ServletContextListener{ @Override public void contextInitialized(ServletContextEvent arg0) {

Re: getting current context

2011-05-19 Thread Mateu Yabar
here any way to know which is the current webbap name (path)? The only place I know I can find it is in the context, but as said, I don't know how to get the context from an static method. Any help there? On 19 May 2011 16:27, Mark Thomas wrote: > On 19/05/2011 15:24, Mateu Yabar wrote: &g

Re: getting current context

2011-05-19 Thread Mateu Yabar
;listSessionIds", null, null); But the invocation return an emtpy string. On 19 May 2011 15:45, chris derham wrote: > On Thu, May 19, 2011 at 10:33 AM, Mateu Yabar >wrote: > > > After all day working on this, I'm still unable to use JMX to obtain the > >

Re: getting current context

2011-05-19 Thread Mateu Yabar
After all day working on this, I'm still unable to use JMX to obtain the context. Please, can anyone gime me a hand? Thanks! On 19 May 2011 13:12, Mateu Yabar wrote: > > > > 2. The OP wants current sessions so a ServletContextListener that only > > runs at context start

Re: getting current context

2011-05-19 Thread Mateu Yabar
> > 2. The OP wants current sessions so a ServletContextListener that only > runs at context start and stop isn't going to help. > In ServletContextListener, arg0.getServletContext(), only gives a ApplicationContextFacade, but I can access apache context from there, so I can't get the active sessi

Re: getting current context

2011-05-19 Thread Mateu Yabar
Thanks! I'm looking through JMX (I don't nothing about it), but meanwhile, can anyone tell me how to access the Context through JMX? On 19 May 2011 11:41, Mark Thomas wrote: > On 19/05/2011 10:36, Micka wrote: > > Hi, > > > > You should implents ServletContextListener to get the context () : >

getting current context

2011-05-19 Thread Mateu Yabar
Hi to all, I need to obtain the number of active sessions on the current application. If written the following (import org.apache.catalina.Context, import org.apache.catalina.Manager): public int getActiveSession(){ Context context=null; Manager manager=context.getManager(); return manager.getActi