jspwiki-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mets...@apache.org
Subject svn commit: r775601 - in /incubator/jspwiki/trunk: ChangeLog build.xml src/java/org/apache/wiki/Release.java src/java/org/apache/wiki/ui/WikiServletFilter.java
Date Sun, 17 May 2009 09:00:18 GMT
Author: metskem
Date: Sun May 17 09:00:18 2009
New Revision: 775601

URL: http://svn.apache.org/viewvc?rev=775601&view=rev
Log:
3.0.0-svn-118
        
        * JSPWIKI-534 WikiServletFilter now lazily initializes, so that the
           StripesFilter always init's first. 
           This was necessary for running in Jetty.
           
        * included jasper-runtime-*.jar in the copy-step for preparation in
           running the webtests.
           The webtests still don't work, something selenium-specific that I
           could not find yet.

Modified:
    incubator/jspwiki/trunk/ChangeLog
    incubator/jspwiki/trunk/build.xml
    incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/ui/WikiServletFilter.java

Modified: incubator/jspwiki/trunk/ChangeLog
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/ChangeLog?rev=775601&r1=775600&r2=775601&view=diff
==============================================================================
--- incubator/jspwiki/trunk/ChangeLog (original)
+++ incubator/jspwiki/trunk/ChangeLog Sun May 17 09:00:18 2009
@@ -1,3 +1,16 @@
+2009-05-17  Harry Metske <metskem@apache.org>
+
+        * 3.0.0-svn-118
+        
+        * JSPWIKI-534 WikiServletFilter now lazily initializes, so that the
+           StripesFilter always init's first. 
+           This was necessary for running in Jetty.
+           
+        * included jasper-runtime-*.jar in the copy-step for preparation in
+           running the webtests.
+           The webtests still don't work, something selenium-specific that I
+           could not find yet. 
+
 2009-05-15  Harry Metske <metskem@apache.org>
 
         * 3.0.0-svn-117

Modified: incubator/jspwiki/trunk/build.xml
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/build.xml?rev=775601&r1=775600&r2=775601&view=diff
==============================================================================
--- incubator/jspwiki/trunk/build.xml (original)
+++ incubator/jspwiki/trunk/build.xml Sun May 17 09:00:18 2009
@@ -934,6 +934,7 @@
         <fileset dir="${code.web}" includes="**" excludes="**/servlet-api.jar **/jsp-api.jar
WEB-INF/web.xml" />
         <fileset file="${jarfile}"/>
         <fileset file="${jdbc.driver.jar}"/>
+      	<fileset file="${tests}/lib/jasper-runtime-*.jar"/>
       </copy>
 
       <!-- Copy the JSPs -->

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java?rev=775601&r1=775600&r2=775601&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java Sun May 17 09:00:18 2009
@@ -77,7 +77,7 @@
      *  <p>
      *  If the build identifier is empty, it is not added.
      */
-    public static final String     BUILD         = "117";
+    public static final String     BUILD         = "118";
     
     /**
      *  This is the generic version string you should use

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/ui/WikiServletFilter.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/ui/WikiServletFilter.java?rev=775601&r1=775600&r2=775601&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/ui/WikiServletFilter.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/ui/WikiServletFilter.java Sun May 17
09:00:18 2009
@@ -61,6 +61,8 @@
 {
     protected static final Logger log = LoggerFactory.getLogger( WikiServletFilter.class
);
     protected WikiEngine m_engine = null;
+    private boolean m_wikiInitialized = false;
+    private FilterConfig m_config =null;
 
     /**
      *  Creates a Wiki Servlet Filter.
@@ -78,12 +80,23 @@
      */
     public void init( FilterConfig config ) throws ServletException
     {
+        // save the reference to config, we need it when we lazy init the wiki in initWiki()
+        m_config = config;
+    }
+
+    /**
+     *  This filter should initialize after the StripesFilter has set up the WikiRuntimeConfiguration.

+     *  To make sure this happens, we do lazy initialization here.
+     */
+    private void initWiki()
+    {
         log.info( "servlet filter " + this.getClass().getName() + " initializing" );
-        ServletContext context = config.getServletContext();
+        ServletContext context = m_config.getServletContext();
         m_engine = WikiEngine.getInstance( context, null );
+        m_wikiInitialized = true;
         log.warn( "servlet filter " + this.getClass().getName() + " initialized" );
     }
-
+    
     /**
      * Destroys the WikiServletFilter.
      */
@@ -105,6 +118,10 @@
     */
     public void doFilter( ServletRequest request, ServletResponse response, FilterChain chain
) throws IOException, ServletException
     {
+        // one time init first
+        if( !m_wikiInitialized )
+            initWiki();
+        
         //
         //  Sanity check; it might be true in some conditions, but we need to know where.
         //



Mime
View raw message