rsitze      2002/09/25 13:54:36

  Modified:    java/src/org/apache/axis/transport/http AxisServlet.java
                        ServletEndpointContextImpl.java
  Log:
  Bugzilla 12972: correct servlet context behaviour in session scope.
  
  Revision  Changes    Path
  1.145     +1 -5      
xml-axis/java/src/org/apache/axis/transport/http/AxisServlet.java
  
  Index: AxisServlet.java
  ===================================================================
  RCS file: 
/home/cvs/xml-axis/java/src/org/apache/axis/transport/http/AxisServlet.java,v
  retrieving revision 1.144
  retrieving revision 1.145
  diff -u -r1.144 -r1.145
  --- AxisServlet.java  25 Sep 2002 18:21:28 -0000      1.144
  +++ AxisServlet.java  25 Sep 2002 20:54:36 -0000      1.145
  @@ -871,11 +871,7 @@
           msgContext.setProperty(Constants.MC_REMOTE_ADDR, req.getRemoteAddr());
   
           // Set up a javax.xml.rpc.server.ServletEndpointContext
  -        ServletEndpointContextImpl sec =
  -                new ServletEndpointContextImpl(new AxisHttpSession(req),
  -                                               msgContext,
  -                                               req.getUserPrincipal(),
  -                                               
getServletConfig().getServletContext());
  +        ServletEndpointContextImpl sec = new ServletEndpointContextImpl();
   
           msgContext.setProperty(Constants.MC_SERVLET_ENDPOINT_CONTEXT, sec);
           /* Save the real path */
  
  
  
  1.3       +13 -18    
xml-axis/java/src/org/apache/axis/transport/http/ServletEndpointContextImpl.java
  
  Index: ServletEndpointContextImpl.java
  ===================================================================
  RCS file: 
/home/cvs/xml-axis/java/src/org/apache/axis/transport/http/ServletEndpointContextImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ServletEndpointContextImpl.java   13 Aug 2002 00:38:46 -0000      1.2
  +++ ServletEndpointContextImpl.java   25 Sep 2002 20:54:36 -0000      1.3
  @@ -62,34 +62,29 @@
   
   public class ServletEndpointContextImpl implements ServletEndpointContext {
       
  -    private AxisHttpSession httpSession;
  -    private MessageContext msgContext ;
  -    private ServletContext servletContext;
  -    private Principal principal;
  -    
       public HttpSession getHttpSession() {
  -        return httpSession.getRep();
  +        javax.servlet.http.HttpServletRequest srvreq =
  +            (javax.servlet.http.HttpServletRequest) 
  +                
getMessageContext().getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST);
  +        return (srvreq == null)  ? null : srvreq.getSession();
       }
   
       public MessageContext getMessageContext() {
  -        return msgContext;
  +        return org.apache.axis.MessageContext.getCurrentContext();
       }
   
       public ServletContext getServletContext() {
  -        return servletContext;
  +        javax.servlet.http.HttpServlet srv =
  +            (javax.servlet.http.HttpServlet)
  +                getMessageContext().getProperty(HTTPConstants.MC_HTTP_SERVLET);
  +        return (srv == null) ? null : srv.getServletContext();
       }
   
       public Principal getUserPrincipal() {
  -        return principal;
  -    }
  +        javax.servlet.http.HttpServletRequest srvreq =
  +            (javax.servlet.http.HttpServletRequest)
  +                
getMessageContext().getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST);
   
  -    /**
  -     * Full constructor
  -     */ 
  -    public ServletEndpointContextImpl(AxisHttpSession httpSession, MessageContext 
msgContext, Principal principal, ServletContext servletContext) {
  -        this.httpSession = httpSession;
  -        this.msgContext = msgContext;
  -        this.principal = principal;
  -        this.servletContext = servletContext;
  +        return (srvreq == null) ? null : srvreq.getUserPrincipal();
       }
   }
  
  
  


Reply via email to