|
|
|
Cagatay Civici
|
Some javascript/style in this post has been disabled (why?)
Hi,Suppose Atmosphere Servlet is mapped to; <servlet> <servlet-name>AtmosphereServlet</servlet-name> <servlet-class>org.atmosphere.cpr.AtmosphereServlet</servlet-class> <load-on-startup>0</load-on-startup> </servlet> <servlet-mapping> <servlet-name>AtmosphereServlet</servlet-name> <url-pattern>/primefaces_comet/*</url-pattern> </servlet-mapping> And in atmosphere.xml, a custom atmosphere handler is mapped to; <atmosphere-handlers> <atmosphere-handler context-root="/chat" class-name="org.primefaces.comet.PrimeFacesAtmosphereHandler" /> </atmosphere-handlers> So should a request like "http://#{contextPath}/primefaces_comet/chat" map to the custom AtmosphereHandler? That doesn't seem to working well but changing context-root to; <atmosphere-handlers> <atmosphere-handler context-root="/primefaces_comet/*" class-name="org.primefaces.comet.PrimeFacesAtmosphereHandler" /> </atmosphere-handlers> is working. I'm a bit confused about the context-root mappings of servlet and the atmosphere handlers. I'd be glad if you can clarify it. Regards, Cagatay |
||||||||||||||||
|
Jeanfrancois Arcand
|
Salut,
Cagatay Civici wrote: > Hi, > > Suppose Atmosphere Servlet is mapped to; > > <servlet> > <servlet-name>AtmosphereServlet</servlet-name> > <servlet-class>org.atmosphere.cpr.AtmosphereServlet</servlet-class> > <load-on-startup>0</load-on-startup> > </servlet> > <servlet-mapping> > <servlet-name>AtmosphereServlet</servlet-name> > <url-pattern>/primefaces_comet/*</url-pattern> > </servlet-mapping> > > And in atmosphere.xml, a custom atmosphere handler is mapped to; > > <atmosphere-handlers> > <atmosphere-handler context-root="/chat" > class-name="org.primefaces.comet.PrimeFacesAtmosphereHandler" /> > </atmosphere-handlers> > > So should a request like "http://#{contextPath}/primefaces_comet/chat" > map to the custom AtmosphereHandler? That doesn't seem to working well > but changing context-root to; > > <atmosphere-handlers> > > <atmosphere-handler context-root="/primefaces_comet/*" class-name="org.primefaces.comet.PrimeFacesAtmosphereHandler" /> > </atmosphere-handlers> > > is working. I'm a bit confused about the context-root mappings of > servlet and the atmosphere handlers. I'd be glad if you can clarify it. No the above is right. This is how it is supposed to work. Which WebServer are you using? Let me write a simple test just to make sure... A+ -- Jeanfrancois > > Regards, > > Cagatay --------------------------------------------------------------------- To unsubscribe, e-mail: [hidden email] For additional commands, e-mail: [hidden email] |
||||||||||||||||
|
Jeanfrancois Arcand
|
Jeanfrancois Arcand wrote: > Salut, > > Cagatay Civici wrote: >> Hi, >> >> Suppose Atmosphere Servlet is mapped to; >> >> <servlet> >> <servlet-name>AtmosphereServlet</servlet-name> >> <servlet-class>org.atmosphere.cpr.AtmosphereServlet</servlet-class> >> <load-on-startup>0</load-on-startup> >> </servlet> >> <servlet-mapping> >> <servlet-name>AtmosphereServlet</servlet-name> >> <url-pattern>/primefaces_comet/*</url-pattern> >> </servlet-mapping> >> >> And in atmosphere.xml, a custom atmosphere handler is mapped to; >> >> <atmosphere-handlers> >> <atmosphere-handler context-root="/chat" >> class-name="org.primefaces.comet.PrimeFacesAtmosphereHandler" /> >> </atmosphere-handlers> >> >> So should a request like "http://#{contextPath}/primefaces_comet/chat" >> map to the custom AtmosphereHandler? That doesn't seem to working well >> but changing context-root to; >> >> <atmosphere-handlers> >> <atmosphere-handler context-root="/primefaces_comet/*" >> class-name="org.primefaces.comet.PrimeFacesAtmosphereHandler" /> >> </atmosphere-handlers> >> >> is working. I'm a bit confused about the context-root mappings of >> servlet and the atmosphere handlers. I'd be glad if you can clarify it. > > No the above is right. Oh I've found a bug in my code (again...grrr). Right now the AtmosphereHandler is mapped using the getServletPath(), which means you need to have the same mapping than web.xml...which is wrong! The original idea was to use the getPathInfo(), which I will implement now. Good catch! -- Jeanfrancois This is how it is supposed to work. Which > WebServer are you using? Let me write a simple test just to make sure... > > A+ > > -- Jeanfrancois > > > > >> >> Regards, >> >> Cagatay > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [hidden email] > For additional commands, e-mail: [hidden email] > --------------------------------------------------------------------- To unsubscribe, e-mail: [hidden email] For additional commands, e-mail: [hidden email] |
||||||||||||||||
|
Jeanfrancois Arcand
|
Salut,
Jeanfrancois Arcand wrote: > > > Jeanfrancois Arcand wrote: >> Salut, >> >> Cagatay Civici wrote: >>> Hi, >>> >>> Suppose Atmosphere Servlet is mapped to; >>> >>> <servlet> >>> <servlet-name>AtmosphereServlet</servlet-name> >>> <servlet-class>org.atmosphere.cpr.AtmosphereServlet</servlet-class> >>> <load-on-startup>0</load-on-startup> >>> </servlet> >>> <servlet-mapping> >>> <servlet-name>AtmosphereServlet</servlet-name> >>> <url-pattern>/primefaces_comet/*</url-pattern> >>> </servlet-mapping> >>> >>> And in atmosphere.xml, a custom atmosphere handler is mapped to; >>> >>> <atmosphere-handlers> >>> <atmosphere-handler context-root="/chat" >>> class-name="org.primefaces.comet.PrimeFacesAtmosphereHandler" /> >>> </atmosphere-handlers> >>> >>> So should a request like >>> "http://#{contextPath}/primefaces_comet/chat" map to the custom >>> AtmosphereHandler? That doesn't seem to working well but changing >>> context-root to; >>> >>> <atmosphere-handlers> >>> <atmosphere-handler context-root="/primefaces_comet/*" >>> class-name="org.primefaces.comet.PrimeFacesAtmosphereHandler" /> >>> </atmosphere-handlers> >>> >>> is working. I'm a bit confused about the context-root mappings of >>> servlet and the atmosphere handlers. I'd be glad if you can clarify it. >> >> No the above is right. > > Oh I've found a bug in my code (again...grrr). Right now the > AtmosphereHandler is mapped using the getServletPath(), which means you > need to have the same mapping than web.xml...which is wrong! > > The original idea was to use the getPathInfo(), which I will implement now. > > Good catch! <<sorry for the confusion>> OK the more I think of it, the more I think the current behavior is correct (or semi-correct). The mapping of AtmosphereHandler is based on the HttpServletRequest.getServletPath(). Using the HttpServletRequest.getPathInfo() is incorrect IMO as it will breaks existing application when they run with the ReflectorServletProcessor. So I think the rule should be: >>> <servlet> >>> <servlet-name>AtmosphereServlet</servlet-name> >>> <servlet-class>org.atmosphere.cpr.AtmosphereServlet</servlet-class> >>> <load-on-startup>0</load-on-startup> >>> </servlet> >>> <servlet-mapping> >>> <servlet-name>AtmosphereServlet</servlet-name> >>> <url-pattern>/primefaces_comet/*</url-pattern> >>> </servlet-mapping> Then atmosphere.xml >>>> <atmosphere-handlers> >>>> <atmosphere-handler context-root="/primefaces_comet/Chat" >>>> class-name="org.primefaces.comet.PrimeFacesAtmosphereHandler" /> >>>> </atmosphere-handlers> Should works. Now it doesn't right now and this is the part I will fix. What do you think? Thanks -- Jeanfrancois > > -- Jeanfrancois > > This is how it is supposed to work. Which >> WebServer are you using? Let me write a simple test just to make sure... >> >> A+ >> >> -- Jeanfrancois >> >> >> >> >>> >>> Regards, >>> >>> Cagatay >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [hidden email] >> For additional commands, e-mail: [hidden email] >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [hidden email] > For additional commands, e-mail: [hidden email] > --------------------------------------------------------------------- To unsubscribe, e-mail: [hidden email] For additional commands, e-mail: [hidden email] |
||||||||||||||||
|
Jeanfrancois Arcand
|
Salut
Jeanfrancois Arcand wrote: > Salut, > > Jeanfrancois Arcand wrote: >> >> >> Jeanfrancois Arcand wrote: >>> Salut, >>> >>> Cagatay Civici wrote: >>>> Hi, >>>> >>>> Suppose Atmosphere Servlet is mapped to; >>>> >>>> <servlet> >>>> <servlet-name>AtmosphereServlet</servlet-name> >>>> <servlet-class>org.atmosphere.cpr.AtmosphereServlet</servlet-class> >>>> <load-on-startup>0</load-on-startup> >>>> </servlet> >>>> <servlet-mapping> >>>> <servlet-name>AtmosphereServlet</servlet-name> >>>> <url-pattern>/primefaces_comet/*</url-pattern> >>>> </servlet-mapping> >>>> >>>> And in atmosphere.xml, a custom atmosphere handler is mapped to; >>>> >>>> <atmosphere-handlers> >>>> <atmosphere-handler context-root="/chat" >>>> class-name="org.primefaces.comet.PrimeFacesAtmosphereHandler" /> >>>> </atmosphere-handlers> >>>> >>>> So should a request like >>>> "http://#{contextPath}/primefaces_comet/chat" map to the custom >>>> AtmosphereHandler? That doesn't seem to working well but changing >>>> context-root to; >>>> >>>> <atmosphere-handlers> >>>> <atmosphere-handler context-root="/primefaces_comet/*" >>>> class-name="org.primefaces.comet.PrimeFacesAtmosphereHandler" /> >>>> </atmosphere-handlers> >>>> >>>> is working. I'm a bit confused about the context-root mappings of >>>> servlet and the atmosphere handlers. I'd be glad if you can clarify it. >>> >>> No the above is right. >> >> Oh I've found a bug in my code (again...grrr). Right now the >> AtmosphereHandler is mapped using the getServletPath(), which means >> you need to have the same mapping than web.xml...which is wrong! >> >> The original idea was to use the getPathInfo(), which I will implement >> now. >> >> Good catch! > > <<sorry for the confusion>> > > OK the more I think of it, the more I think the current behavior is > correct (or semi-correct). The mapping of AtmosphereHandler is based on > the HttpServletRequest.getServletPath(). Using the > HttpServletRequest.getPathInfo() is incorrect IMO as it will breaks > existing application when they run with the ReflectorServletProcessor. > So I think the rule should be: > > >>> <servlet> > >>> <servlet-name>AtmosphereServlet</servlet-name> > >>> > <servlet-class>org.atmosphere.cpr.AtmosphereServlet</servlet-class> > >>> <load-on-startup>0</load-on-startup> > >>> </servlet> > >>> <servlet-mapping> > >>> <servlet-name>AtmosphereServlet</servlet-name> > >>> <url-pattern>/primefaces_comet/*</url-pattern> > >>> </servlet-mapping> > > Then atmosphere.xml > >>>>> <atmosphere-handlers> >>>>> <atmosphere-handler context-root="/primefaces_comet/Chat" >>>>> class-name="org.primefaces.comet.PrimeFacesAtmosphereHandler" /> >>>>> </atmosphere-handlers> > > Should works. Now it doesn't right now and this is the part I will fix. > What do you think? I did add the PathInfo mapping support: New Revision: 654 Still I want to know what peoples thinks. Thanks! -- Jeanfrancois > > Thanks > > -- Jeanfrancois > > > >> >> -- Jeanfrancois >> >> This is how it is supposed to work. Which >>> WebServer are you using? Let me write a simple test just to make sure... >>> >>> A+ >>> >>> -- Jeanfrancois >>> >>> >>> >>> >>>> >>>> Regards, >>>> >>>> Cagatay >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: [hidden email] >>> For additional commands, e-mail: [hidden email] >>> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [hidden email] >> For additional commands, e-mail: [hidden email] >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [hidden email] > For additional commands, e-mail: [hidden email] > --------------------------------------------------------------------- To unsubscribe, e-mail: [hidden email] For additional commands, e-mail: [hidden email] |
||||||||||||||||
|
Cagatay Civici
|
Hi,
<atmosphere-handlers> <atmosphere-handler context-root="/primefaces_ comet/Chat" class-name="org.primefaces.comet.PrimeFacesAtmosphereHandler" /> Yes, I'd like to define the servlet path in the atmosphere handler context-root since it seems more fine-grained. Also compatible with ReflectorServletProcessor. Regards, Cagatay On Thu, Nov 5, 2009 at 3:02 AM, Jeanfrancois Arcand <[hidden email]> wrote: Salut |
||||||||||||||||
|
Jeanfrancois Arcand
|
Salut, Cagatay Civici wrote: > Hi, > > <atmosphere-handlers> > <atmosphere-handler context-root="/primefaces_ > > comet/Chat" > class-name="org.primefaces.comet.PrimeFacesAtmosphereHandler" /> > </atmosphere-handlers> > > > Yes, I'd like to define the servlet path in the atmosphere handler > context-root since it seems more fine-grained. Also compatible with > ReflectorServletProcessor. Perfect! This is what I've implemented yesterday night. I will go ahead and clarify the documentation. Thanks for the help!! -- Jeanfrancois > > Regards, > > Cagatay > > On Thu, Nov 5, 2009 at 3:02 AM, Jeanfrancois Arcand > <[hidden email] <mailto:[hidden email]>> wrote: > > Salut > > > Jeanfrancois Arcand wrote: > > Salut, > > Jeanfrancois Arcand wrote: > > > > Jeanfrancois Arcand wrote: > > Salut, > > Cagatay Civici wrote: > > Hi, > > Suppose Atmosphere Servlet is mapped to; > > <servlet> > <servlet-name>AtmosphereServlet</servlet-name> > > <servlet-class>org.atmosphere.cpr.AtmosphereServlet</servlet-class> > <load-on-startup>0</load-on-startup> > </servlet> > <servlet-mapping> > <servlet-name>AtmosphereServlet</servlet-name> > <url-pattern>/primefaces_comet/*</url-pattern> > </servlet-mapping> > > And in atmosphere.xml, a custom atmosphere handler > is mapped to; > > <atmosphere-handlers> > <atmosphere-handler context-root="/chat" > class-name="org.primefaces.comet.PrimeFacesAtmosphereHandler" > /> > </atmosphere-handlers> > > So should a request like > "http://#{contextPath}/primefaces_comet/chat" map to > the custom AtmosphereHandler? That doesn't seem to > working well but changing context-root to; > > <atmosphere-handlers> > <atmosphere-handler > context-root="/primefaces_comet/*" > class-name="org.primefaces.comet.PrimeFacesAtmosphereHandler" > /> > </atmosphere-handlers> > > is working. I'm a bit confused about the > context-root mappings of servlet and the atmosphere > handlers. I'd be glad if you can clarify it. > > > No the above is right. > > > Oh I've found a bug in my code (again...grrr). Right now the > AtmosphereHandler is mapped using the getServletPath(), > which means you need to have the same mapping than > web.xml...which is wrong! > > The original idea was to use the getPathInfo(), which I will > implement now. > > Good catch! > > > <<sorry for the confusion>> > > OK the more I think of it, the more I think the current behavior > is correct (or semi-correct). The mapping of AtmosphereHandler > is based on the HttpServletRequest.getServletPath(). Using the > HttpServletRequest.getPathInfo() is incorrect IMO as it will > breaks existing application when they run with the > ReflectorServletProcessor. So I think the rule should be: > > >>> <servlet> > >>> <servlet-name>AtmosphereServlet</servlet-name> > >>> > <servlet-class>org.atmosphere.cpr.AtmosphereServlet</servlet-class> > >>> <load-on-startup>0</load-on-startup> > >>> </servlet> > >>> <servlet-mapping> > >>> <servlet-name>AtmosphereServlet</servlet-name> > >>> <url-pattern>/primefaces_comet/*</url-pattern> > >>> </servlet-mapping> > > Then atmosphere.xml > > <atmosphere-handlers> > <atmosphere-handler > context-root="/primefaces_comet/Chat" > class-name="org.primefaces.comet.PrimeFacesAtmosphereHandler" > /> > </atmosphere-handlers> > > > Should works. Now it doesn't right now and this is the part I > will fix. What do you think? > > > I did add the PathInfo mapping support: > > New Revision: 654 > > Still I want to know what peoples thinks. > > Thanks! > > -- Jeanfrancois > > > > > > Thanks > > -- Jeanfrancois > > > > > -- Jeanfrancois > > This is how it is supposed to work. Which > > WebServer are you using? Let me write a simple test just > to make sure... > > A+ > > -- Jeanfrancois > > > > > > Regards, > > Cagatay > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > [hidden email] > <mailto:[hidden email]> > For additional commands, e-mail: > [hidden email] > <mailto:[hidden email]> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > [hidden email] > <mailto:[hidden email]> > For additional commands, e-mail: > [hidden email] > <mailto:[hidden email]> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > [hidden email] > <mailto:[hidden email]> > For additional commands, e-mail: > [hidden email] > <mailto:[hidden email]> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [hidden email] > <mailto:[hidden email]> > For additional commands, e-mail: [hidden email] > <mailto:[hidden email]> > > --------------------------------------------------------------------- To unsubscribe, e-mail: [hidden email] For additional commands, e-mail: [hidden email] |
||||||||||||||||
|
laptopbob
|
So, does this mean that in 0.4.1 it isn't possible to define more than 1 atmosphere Handler?
Right now I have the atmosphere servlet mapped to /atmosphere/*, and my handler has a context root of /atmosphere. This works, but I want to have 2 atmosphere handlers, mapped to /atmosphere/handler1 and /atmosphere/handler2 for example. However, if I change the context root of a handler to anything except /atmosphere it doesn't work, probably for the reasons mentioned in this thread. Is there a way around this without upgrading past the stable 0.4.1 release?
|
||||||||||||||||
| Free Embeddable Forum Powered by Nabble | Help |