You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by ga...@apache.org on 2008/04/10 07:08:50 UTC
svn commit: r646649 -
/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/context/utils/ContextUtils.java
Author: gawor
Date: Wed Apr 9 22:08:49 2008
New Revision: 646649
URL: http://svn.apache.org/viewvc?rev=646649&view=rev
Log:
set SERVLET_CONTEXT property only when set (part of AXIS2-3720)
Modified:
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/context/utils/ContextUtils.java
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/context/utils/ContextUtils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/context/utils/ContextUtils.java?rev=646649&r1=646648&r2=646649&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/context/utils/ContextUtils.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/context/utils/ContextUtils.java Wed Apr 9 22:08:49 2008
@@ -34,6 +34,7 @@
import org.apache.commons.logging.LogFactory;
import org.w3c.dom.Element;
+import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.xml.namespace.QName;
@@ -115,17 +116,16 @@
// If we are running within a servlet container, then JAX-WS requires that the
// servlet related properties be set on the MessageContext
- soapMessageContext.put(javax.xml.ws.handler.MessageContext.SERVLET_CONTEXT,
- jaxwsMessageContext.getProperty(HTTPConstants.MC_HTTP_SERVLETCONTEXT));
- soapMessageContext
+ ServletContext servletContext =
+ (ServletContext)jaxwsMessageContext.getProperty(HTTPConstants.MC_HTTP_SERVLETCONTEXT);
+ if (servletContext != null) {
+ log.debug("Servlet Context Set");
+ soapMessageContext.put(javax.xml.ws.handler.MessageContext.SERVLET_CONTEXT,
+ servletContext);
+ soapMessageContext
.setScope(javax.xml.ws.handler.MessageContext.SERVLET_CONTEXT, Scope.APPLICATION);
-
- if (log.isDebugEnabled()) {
- if (jaxwsMessageContext.getProperty(HTTPConstants.MC_HTTP_SERVLETCONTEXT) != null) {
- log.debug("Servlet Context Set");
- } else {
- log.debug("Servlet Context not found");
- }
+ } else {
+ log.debug("Servlet Context not found");
}
HttpServletRequest req = (HttpServletRequest)jaxwsMessageContext
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org