Revision: 360
Author:   tfenne
Date:     2006-08-09 17:10:19 -0700 (Wed, 09 Aug 2006)
ViewCVS:  http://svn.sourceforge.net/stripes/?rev=360&view=rev

Log Message:
-----------
Fix for STS-185: ability to access the servlet context through the Configuration

Modified Paths:
--------------
    trunk/stripes/src/net/sourceforge/stripes/config/Configuration.java
    trunk/stripes/src/net/sourceforge/stripes/config/DefaultConfiguration.java
Modified: trunk/stripes/src/net/sourceforge/stripes/config/Configuration.java
===================================================================
--- trunk/stripes/src/net/sourceforge/stripes/config/Configuration.java 
2006-08-10 00:00:47 UTC (rev 359)
+++ trunk/stripes/src/net/sourceforge/stripes/config/Configuration.java 
2006-08-10 00:10:19 UTC (rev 360)
@@ -27,6 +27,7 @@
 import net.sourceforge.stripes.controller.LifecycleStage;
 import net.sourceforge.stripes.exception.ExceptionHandler;
 
+import javax.servlet.ServletContext;
 import java.util.Collection;
 
 /**
@@ -69,6 +70,14 @@
     BootstrapPropertyResolver getBootstrapPropertyResolver();
 
     /**
+     * Retrieves the ServletContext for the context within which the Stripes 
application
+     * is executing.
+     *
+     * @return the ServletContext in which the application is running
+     */
+    ServletContext getServletContext();
+
+    /**
      * Returns an instance of ActionResolver that will be used by Stripes to 
lookup and resolve
      * ActionBeans.  The instance should be cached by the Configuration since 
multiple entities
      * in the system may access the ActionResolver throughout the lifetime of 
the application.

Modified: 
trunk/stripes/src/net/sourceforge/stripes/config/DefaultConfiguration.java
===================================================================
--- trunk/stripes/src/net/sourceforge/stripes/config/DefaultConfiguration.java  
2006-08-10 00:00:47 UTC (rev 359)
+++ trunk/stripes/src/net/sourceforge/stripes/config/DefaultConfiguration.java  
2006-08-10 00:10:19 UTC (rev 360)
@@ -40,6 +40,7 @@
 import net.sourceforge.stripes.validation.DefaultTypeConverterFactory;
 import net.sourceforge.stripes.validation.TypeConverterFactory;
 
+import javax.servlet.ServletContext;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -176,6 +177,16 @@
     }
 
     /**
+     * Retrieves the ServletContext for the context within which the Stripes 
application is
+     * executing.
+     *
+     * @return the ServletContext in which the application is running
+     */
+    public ServletContext getServletContext() {
+        return 
getBootstrapPropertyResolver().getFilterConfig().getServletContext();
+    }
+
+    /**
      * Returns an instance of [EMAIL PROTECTED] NameBasedActionResolver} 
unless a subclass has
      * overridden the default.
      * @return ActionResolver an instance of the configured resolver
@@ -291,7 +302,9 @@
      */
     public Collection<Interceptor> getInterceptors(LifecycleStage stage) {
         Collection<Interceptor> interceptors = this.interceptors.get(stage);
-        if (interceptors == null) interceptors = Collections.emptyList();
+        if (interceptors == null) {
+            interceptors = Collections.emptyList();
+        }
         return interceptors;
     }
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to