cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "willem Jiang (JIRA)" <j...@apache.org>
Subject [jira] Assigned: (CXF-750) Support using Session in standalone
Date Thu, 28 Jun 2007 08:30:26 GMT

     [ https://issues.apache.org/jira/browse/CXF-750?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

willem Jiang reassigned CXF-750:
--------------------------------

    Assignee: willem Jiang

> Support using Session in standalone
> -----------------------------------
>
>                 Key: CXF-750
>                 URL: https://issues.apache.org/jira/browse/CXF-750
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-WS Runtime
>            Reporter: Jervis Liu
>            Assignee: willem Jiang
>
> Following code snippet should work when cxf is deployed in standalone mode (Jetty):
>     @Resource
>     private WebServiceContext context;
>     public final List<String> ping() {
>         MessageContext mc = context.getMessageContext();
>         HttpSession session = ((javax.servlet.http.HttpServletRequest)mc.get(MessageContext.SERVLET_REQUEST))
>             .getSession();
>         // Get a session property "counter" from context
>         if (session == null) {
>             throw new WebServiceException("No session in WebServiceContext");
>         }
>         Integer counter = (Integer)session.getAttribute("counter");
>         if (counter == null) {
>             counter = new Integer(0);
>             System.out.println("Starting the Session");
>         }
>         counter = new Integer(counter.intValue() + 1);
>         session.setAttribute("counter", counter);
>         System.out.println("------------" + counter);
>         return counter;
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message