开发者

red5 and servlets: How can I get HttpServerRequest and HttpServerResponse?

I'm trying to write an application for red5 that uses some servlet classes in order to package a requestion for facebook.

the client side is a Adobe flash builder application.

is it possible to send session information from the flex application in order for the red5 client side to create proper HttpServletRequest and HttpServletResponse objects?

in tomcat the code would be:

public void doGet (HttpServletRequest req,
                                     HttpServletResponse res)
    throws ServletE开发者_如何学Cxception, IOException
 {
        HttpServletRequest request = (HttpServletRequest)req;
        HttpServletResponse response = (HttpServletResponse)res;

       ...

}


Quick answer is yes, but I think you may be actually wanting access to the "flash" part of the server via Java EE. In that case you will need to access your applications context via the servlet like so:

ApplicationContext appCtx = (ApplicationContext) getServletContext().getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);

With the context in-hand, you can access all your beans etc..
Helpful link: http://wiki.red5.org/wiki/Documentation/Tutorials/Red5DeveloperTips/FiveWaysToApplicationAdapter

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜