001: package org.apache.struts.wrapper;
002:
003: import java.io.InputStream;
004: import java.net.MalformedURLException;
005: import java.net.URL;
006: import java.util.Enumeration;
007: import java.util.Set;
008:
009: import javax.portlet.PortletContext;
010:
011: import javax.servlet.ServletContext;
012:
013: public class StrutsServletContext implements ServletContext {
014: private PortletContext _context;
015: private ServletContext _sCtx;
016:
017: public StrutsServletContext(ServletContext sContext,
018: PortletContext pContext) {
019: _context = pContext;
020: _sCtx = sContext;
021: }
022:
023: public ServletContext getContext(String context) {
024: return _sCtx.getContext(context);
025: }
026:
027: public int getMajorVersion() {
028: return _context.getMajorVersion();
029: }
030:
031: public int getMinorVersion() {
032: return _context.getMinorVersion();
033: }
034:
035: public String getMimeType(String file) {
036: return _context.getMimeType(file);
037: }
038:
039: public java.util.Set getResourcePaths(String path) {
040: return _context.getResourcePaths(path);
041: }
042:
043: public java.net.URL getResource(String path)
044: throws java.net.MalformedURLException {
045: return _context.getResource(path);
046: }
047:
048: public java.io.InputStream getResourceAsStream(String path) {
049: return _context.getResourceAsStream(path);
050: }
051:
052: public javax.servlet.RequestDispatcher getRequestDispatcher(
053: String name) {
054: return _sCtx.getRequestDispatcher(name);
055: }
056:
057: public javax.servlet.RequestDispatcher getNamedDispatcher(
058: String name) {
059: return _sCtx.getNamedDispatcher(name);
060: }
061:
062: public javax.servlet.Servlet getServlet(String name)
063: throws javax.servlet.ServletException {
064: return _sCtx.getServlet(name);
065: }
066:
067: public java.util.Enumeration getServlets() {
068: return _sCtx.getServlets();
069: }
070:
071: public java.util.Enumeration getServletNames() {
072: return _sCtx.getServletNames();
073: }
074:
075: public void log(java.lang.String msg) {
076: _context.log(msg);
077: }
078:
079: public void log(java.lang.String message,
080: java.lang.Throwable throwable) {
081: _context.log(message, throwable);
082: }
083:
084: public void log(Exception exception, String message) {
085: _sCtx.log(exception, message);
086: }
087:
088: public String getRealPath(String path) {
089: return _context.getRealPath(path);
090: }
091:
092: public String getServerInfo() {
093: return _context.getServerInfo();
094: }
095:
096: public java.lang.String getInitParameter(java.lang.String name) {
097: return _context.getInitParameter(name);
098: }
099:
100: public java.util.Enumeration getInitParameterNames() {
101: return _context.getInitParameterNames();
102: }
103:
104: public java.lang.Object getAttribute(java.lang.String name) {
105: return _context.getAttribute(name);
106: }
107:
108: public java.util.Enumeration getAttributeNames() {
109: return _context.getAttributeNames();
110: }
111:
112: public void removeAttribute(java.lang.String name) {
113: _context.removeAttribute(name);
114: }
115:
116: public void setAttribute(java.lang.String name,
117: java.lang.Object object) {
118: _context.setAttribute(name, object);
119: }
120:
121: public String getServletContextName() {
122: return _context.getPortletContextName();
123: }
124:
125: }
|