2 Replies Latest reply on Jul 18, 2011 2:58 AM by Karl_Sigiscar_1971

    how to get servlet session object?

    smart2008_tw

      Dear all:

      as title, how can i get java servlet session object? i have below flex code, is this correct? second, how to set up xml file? can give me competet example?

      in my flex  i have

      ------------------------------------------------------------------------------------------ --------------------------

      public function init():void {
          
         var licno:String=sessionObject.getHttpRequest.getSession().getAttribute("hello");
                  Alert.show(hello);
        }

       

      <mx:RemoteObject    
        id="sessionObject"    
        showBusyCursor="true"    
        encoding="AMF"      
        source="flashgateway.Gateway">  
        <mx:method   name="getHttpRequest"/>  
      </mx:RemoteObject> 

      ------------------------------------------------------------------------------------------ ------------------------

      in java code

       

      ActionForward template(ActionMapping mapping, ActionForm form,
         HttpServletRequest request, HttpServletResponse response,
         ActionErrors errors) throws Exception {

         session.setAttribute("hello","hello");

        return mapping.findForward(forward);

      }

       

      thanks for helping