001
014
015 package com.liferay.util.axis;
016
017 import javax.servlet.ServletContext;
018 import javax.servlet.http.HttpServlet;
019 import javax.servlet.http.HttpServletRequest;
020 import javax.servlet.http.HttpSession;
021
022 import org.apache.axis.AxisEngine;
023 import org.apache.axis.MessageContext;
024 import org.apache.axis.transport.http.HTTPConstants;
025
026
029 public class ServletUtil {
030
031 public static HttpServletRequest getRequest() {
032 MessageContext messageContext = AxisEngine.getCurrentMessageContext();
033
034 return (HttpServletRequest)messageContext.getProperty(
035 HTTPConstants.MC_HTTP_SERVLETREQUEST);
036 }
037
038 public static HttpServlet getServlet() {
039 MessageContext messageContext = AxisEngine.getCurrentMessageContext();
040
041 return (HttpServlet)messageContext.getProperty(
042 HTTPConstants.MC_HTTP_SERVLET);
043 }
044
045 public static ServletContext getServletContext() {
046 return getServlet().getServletContext();
047 }
048
049 public static HttpSession getSession() {
050 HttpServletRequest request = getRequest();
051
052 return request.getSession();
053 }
054
055 }