Re: [Resin-interest] Comet param via hessian
OK, that did not work!!! To recap: I am trying to pass some value to hessian comet from action script.(ex: member id string room name). Since from .as you can't pass a param to the hessian comet servlet (I wonder why?) and there is no BAM example for action script(and I do not know if BAM works on port 80) Emil recommended: Try this: Create a bean that shared between the comet servlet and a Hessian POJO/servlet within the same web-app. Passing data via application scope works as Emil said... but there's no way to ID what user that is, so that the right users info is passed. (the examples register socket to action script, but no way to ID the user)(if I put it in the app context ... what if another request comes, I have not unique id, not sure how to tell in hessian coment what user that data goes w/). Ex: Using the regular hessian to pass some data via user's uniqe session w/ .as I do: ServletRequest request = ServiceContext.getContextRequest(); HttpServletRequest req = (HttpServletRequest) request; HttpSession ses = req.getSession(true); and put data in ses. Then comet Hessian I do this: HttpServletRequest req = (HttpServletRequest) request; HttpSession ses = req.getSession(false); to get the data. It tells me the session is not there, but I did call the 1st servlet already. My requirement is to register a user to a room and be able to push. Again, if I can pass data to comet for .as, good, which I can't. Or if I can make a a user session in regular hessian, and access that user session in comet hessian. Or something else. tia. .V ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
Re: [Resin-interest] Comet param via hessian
OK, that did not work!!! To recap: I am trying to pass some value to hessian comet from action script.(ex: member id string room name). Since from .as you can't pass a param to the hessian comet servlet (I wonder why?) and there is no BAM example for action script(and I do not know if BAM works on port 80) Emil recommended: Try this: Create a bean that shared between the comet servlet and a Hessian POJO/servlet within the same web-app. Passing data via application scope works as Emil said... but there's no way to ID what user that is, so that the right users info is passed. (the examples register socket to action script, but no way to ID the user)(if I put it in the app context ... what if another request comes, I have not unique id, not sure how to tell in hessian coment what user that data goes w/). Ex: Using the regular hessian to pass some data via user's uniqe session w/ .as I do: ServletRequest request = ServiceContext.getContextRequest(); HttpServletRequest req = (HttpServletRequest) request; HttpSession ses = req.getSession(true); and put data in ses. Then comet Hessian I do this: HttpServletRequest req = (HttpServletRequest) request; HttpSession ses = req.getSession(false); to get the data. It tells me the session is not there, but I did call the 1st servlet already. My requirement is to register a user to a room and be able to push. Again, if I can pass data to comet for .as, good, which I can't. Or if I can make a a user session in regular hessian, and access that user session in comet hessian. Or something else. tia. .V ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
Re: [Resin-interest] Comet param via hessian
Thx Emil for helping me in a jam again!!! So how do I ID the user? Session? Do the 2 servlets(hessian regular and comet) share a session? So in a regular hessian I can pass and set session set userID = 123 roomId = 456. Then comet hessian comes in and gets those out of the session if they exist? From then on the 2 would be locked. That works? .V Emil Ong wrote: On Thu, Sep 11, 2008 at 08:53:25PM -0700, Vic Cekvenich wrote: There has to be a way to hack hessian to pass a param to the comet servelet... hint? Try this: Create a bean that shared between the comet servlet and a Hessian POJO/servlet within the same web-app. Send data upstream to the regular servlet, have the servlet put the data into the bean, and the comet servlet picks it up. The nice thing about the comet servlet in its current API is the CometController lets you wake it up from either the bean or the other servlet. Emil doing standard things, like this from Flex: _push= new HessianStreamingService(pushReg); //servlet _push.responder=this; -- .V [EMAIL PROTECTED] PointCast Network, a screensaver toolkit for next web UI ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
Re: [Resin-interest] Comet param via hessian
On Thu, Sep 11, 2008 at 08:53:25PM -0700, Vic Cekvenich wrote: I posted b4, repost as BAM won't be ready in .as and I need this now. There has to be a way to hack hessian to pass a param to the comet servelet... hint? Try this: Create a bean that shared between the comet servlet and a Hessian POJO/servlet within the same web-app. Send data upstream to the regular servlet, have the servlet put the data into the bean, and the comet servlet picks it up. The nice thing about the comet servlet in its current API is the CometController lets you wake it up from either the bean or the other servlet. Emil doing standard things, like this from Flex: _push= new HessianStreamingService(pushReg); //servlet _push.responder=this; and this on server: public boolean service(ServletRequest request, ServletResponse response, CometController comet) throws IOException, ServletException { HttpServletRequest req = (HttpServletRequest) request; HttpServletResponse res = (HttpServletResponse) response; Hessian2StreamingOutput out; out = new Hessian2StreamingOutput(res.getOutputStream()); req.setAttribute(comet.hessian, out); //String roomId = req.getParameter(roomID); Question: How do I pass a param to the service? (like the last line commented out) For example a room. Comet is a servlet, and I should be able to pass it a parm from hessian somehow. It does not have to be as easy as calling the regualr hessian service, but some way to pass a message from HessianStreamingService that I can then read during the registration of the comet. tia, .V ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest Emil Ong Chief Evangelist Caucho Technology, Inc. Tel. (858) 456-0300 mailto:[EMAIL PROTECTED] http://blog.caucho.com/ Caucho: Reliable Open Source -- Resin: application server -- Quercus: PHP in Java -- Hessian Web Services ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest