How do I get a HttpServletRequest in my spring beans?

前端 未结 6 1217
时光取名叫无心
时光取名叫无心 2020-12-01 01:48

I\'m developing an app with a Flex-based front end and a Spring/Hibernate back-end.

To get Facebook integration working in the way I\'ve got it currently, I need to

6条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-01 02:38

    This is kind of Flex/BlazeDS specific, but here's the solution I've come up with. Sorry if answering my own question is a faux pas.

        HttpServletRequest request = flex.messaging.FlexContext.getHttpRequest();
    
        Cookie[] cookies = request.getCookies();
    
        for (Cookie c:cookies)
        {
            log.debug(String.format("Cookie: %s, %s, domain: %s",c.getName(), c.getValue(),c.getDomain()));
        }
    

    It works, I get the cookies. My problem was looking to Spring - BlazeDS had it. Spring probably does too, but I still don't know how to get to it.

提交回复
热议问题