You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jspwiki.apache.org by aj...@apache.org on 2008/11/24 05:57:20 UTC

svn commit: r720116 [1/3] - in /incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH: doc/ etc/i18n/plugin/ src/com/ecyrd/jspwiki/ src/com/ecyrd/jspwiki/action/ src/com/ecyrd/jspwiki/auth/acl/ src/com/ecyrd/jspwiki/dav/items/ src/com/ecyrd/jspwiki/dif...

Author: ajaquith
Date: Sun Nov 23 20:57:18 2008
New Revision: 720116

URL: http://svn.apache.org/viewvc?rev=720116&view=rev
Log:
HUGE refactoring of Stripes-related code that pries apart the WikiActionBean and WikiContext types. WikiContext is no longer an implementation of WikiActionBean. Instead, WikiActionBeanContext implements WikiContext by wrapping an inner WikiContext implementation (but, it still subclasses Stripes ActionBeanContext). This has all sorts of neat benefits, including near-perfect backwards compatibility with pre-3.0 JSPWiki code. The next check-in will refactor a few more things, but won't be as conceptually disruptive as this one.

Added:
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/DefaultWikiContext.java
Modified:
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/doc/README - Stripes Migration
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/etc/i18n/plugin/PluginResources_en.properties
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/VariableManager.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/WikiContext.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/WikiEngine.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/AbstractActionBean.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/AdministerProfilesActionBean.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/AttachActionBean.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/CommentActionBean.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/DeleteActionBean.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/EditActionBean.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/GroupActionBean.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/InstallActionBean.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/LoginActionBean.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/NewBlogEntryActionBean.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/NewPageActionBean.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/NoneActionBean.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/PageInfoActionBean.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/PageModifiedActionBean.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/RSSActionBean.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/RenameActionBean.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/UploadActionBean.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/UserPreferencesActionBean.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/UserProfileActionBean.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/ViewActionBean.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/WikiActionBean.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/WikiActionBeanContext.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/WikiActionBeanFactory.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/WikiInterceptor.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/auth/acl/DefaultAclManager.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/dav/items/HTMLPageDavItem.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/diff/TraditionalDiffProvider.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/filters/SpamFilter.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/parser/JSPWikiMarkupParser.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/preferences/Preferences.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/providers/CachingProvider.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/rpc/atom/AtomAPIServlet.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/rss/RSSGenerator.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/EditorIteratorTag.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/IteratorTag.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/SearchResultIteratorTag.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/ui/TemplateManager.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/ui/WikiJSPFilter.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/util/BlogUtil.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/xmlrpc/MetaWeblogHandler.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/xmlrpc/RPCHandler.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/xmlrpc/RPCHandlerUTF8.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/TestEngine.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/VariableManagerTest.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/WikiEngineTest.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/action/HandlerInfoTest.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/action/LoginActionBeanTest.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/action/UserPreferencesActionBeanTest.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/action/ViewActionBeanTest.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/action/WikiActionBeanFactoryTest.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/attachment/AttachmentManagerTest.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/content/PageRenamerTest.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/diff/ContextualDiffProviderTest.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/parser/JSPWikiMarkupParserTest.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/plugin/CounterPluginTest.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/plugin/PluginManagerTest.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/plugin/ReferringPagesPluginTest.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/plugin/UndefinedPagesPluginTest.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/providers/RCSFileProviderTest.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/providers/VersioningFileProviderTest.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/render/CreoleRendererTest.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/render/RenderingManagerTest.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/render/WysiwygEditingRendererTest.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/rss/RSSGeneratorTest.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/ui/InputValidatorTest.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/util/MailUtilTest.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/xmlrpc/RPCHandlerTest.java

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/doc/README - Stripes Migration
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/doc/README%20-%20Stripes%20Migration?rev=720116&r1=720115&r2=720116&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/doc/README - Stripes Migration (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/doc/README - Stripes Migration Sun Nov 23 20:57:18 2008
@@ -260,8 +260,8 @@
 
 Notes from Janne Visit:
 ----------------------
-RequestState: interface to most of the forwarding methods below. WikiActionBeanContext implements this.
-WikiActionBeanContext would contain (private/protected) get/sets for JCR context. Not in RequestState or WikiContext interfaces.
+ActionContext: interface to most of the forwarding methods below. WikiActionBeanContext implements this.
+WikiActionBeanContext would contain (private/protected) get/sets for JCR context. Not in ActionContext or WikiContext interfaces.
 
 Mappings from JCR paths to permissions and URLs:
 
@@ -278,33 +278,34 @@
 -----------
 In JSPWiki versions prior to 3.0, WikiContext objects were created by calling a public constructor, followed by a call to setRequestContext(String). In 3.0, however, WikiContext becomes an interface [abtract class?] so contructors don't work. Instead, callers wishing to create WikiContexts should instead use the factory method WikiActionBeanFactory.newActionBean(request,response,beanClass). As an alternative, callers may also call WikiEngine.createContext(request,String).
 
-FORWARDING METHODS
+FORWARDING METHODS -- MOVE TO SUPERINTERFACE ACTIONCONTEXT
+clone() -- needs refactoring
+getBundle()                 to super
+getCurrentUser():           to super
 getEngine():                to super
-getRequestContext():        to super
-getVariable(String):        to super
-setVariable(String,Object): to super
 getHttpParameter(String):   to super
 getHttpRequest():           to super
-setTemplate():              to super
+getLocale(m_context) -- forwards to WikiActionBeanContext.getLocale(); uses Stripes-supplied Locale rather than the one set by Preferences cookies. This is also shared with Stripes class ActionBeanContext, which is rather convenient, no?
+getRequestContext():        to super
 getTemplate():              to super
-getCurrentUser():           to super
+getVariable(String):        to super
 getWikiSession():           to super
-getBundle()                 to super
+setVariable(String,Object): to super
+setTemplate():              to super
 
 WIKI-CONTEXT-SPECIFIC
-setRealPage()
-getRealPage()
 getName():  refactored slightly
+getPage()
+getRealPage()
 getURL(String, String) -- essentially the same, although it assumes StripesURLConstructor is used (?)
 getViewURL()
-setPage()
-findContext() -- no change
-hasAdminPermissions()
-getLocale(m_context) -- forwards to WikiActionBeanContext.getLocale(); uses Stripes-supplied Locale rather than the one set by Preferences cookies.
 D hasAccess(HttpServletResponse) -- used in MANY JSPs. Refactored to look up the permission info for the method that contains @DefaultHander annotation.
 D hasAccess(HttpServletResponse,boolean) -- referenced only by other hasAccess(). 
 setRequestContext() -- now delegates to set the action bean event (if request context matches, otherwise throw error; NONE always matches)
-clone() -- needs refactoring
+setPage()
+setRealPage()
+findContext() -- no change
+hasAdminPermissions()
 
 BACKWARDS INCOMPATIBILITIES
 

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/etc/i18n/plugin/PluginResources_en.properties
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/etc/i18n/plugin/PluginResources_en.properties?rev=720116&r1=720115&r2=720116&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/etc/i18n/plugin/PluginResources_en.properties (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/etc/i18n/plugin/PluginResources_en.properties Sun Nov 23 20:57:18 2008
@@ -46,4 +46,20 @@
 formoutput.missingargument = Argument '{0}' required for Form plugin
 formselect.namemissing = Select element is missing parameter 'name'.
 formtextarea.noneedtoshow = (no need to show textarea field now)
-formtextarea.namemissing = Textarea element is missing parameter 'name'.
\ No newline at end of file
+formtextarea.namemissing = Textarea element is missing parameter 'name'.
+
+# ListLocks plugin
+plugin.listlocks.page=Page
+plugin.listlocks.locked.by=Locked by
+plugin.listlocks.acquired=Acquired
+plugin.listlocks.expires=Expires
+plugin.listlocks.no.locks.exist=No locks exist currently.
+
+# InsertPage plugin
+plugin.insert.notfound=Page could not be found by the page provider.
+plugin.insert.recursion=Error: Circular reference - you can't include a page in itself!
+plugin.insert.nopermission=You do not have permission to view this included page.
+plugin.insert.nopage1=There is no page called
+plugin.insert.nopage2=Would you like to
+plugin.insert.nopage3=create it?
+plugin.insert.definepage=You have to define a page!
\ No newline at end of file

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/VariableManager.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/VariableManager.java?rev=720116&r1=720115&r2=720116&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/VariableManager.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/VariableManager.java Sun Nov 23 20:57:18 2008
@@ -217,7 +217,7 @@
      *  @throws IllegalArgumentException If the name is somehow broken.
      *  @throws NoSuchVariableException If a variable is not known.
      */
-    public String getValue( WikiActionBean context,
+    public String getValue( WikiContext context,
                             String      varName )
         throws IllegalArgumentException,
                NoSuchVariableException
@@ -293,27 +293,24 @@
             // And the final straw: see if the current page has named metadata.
             //
             
-            if ( context instanceof WikiContext )
+            WikiPage pg = context.getPage();
+            if( pg != null )
             {
-                WikiPage pg = ((WikiContext)context).getPage();
-                if( pg != null )
-                {
-                    Object metadata = pg.getAttribute( varName );
-                    if( metadata != null )
-                        return metadata.toString();
-                }
-                //
-                // And the final straw part 2: see if the "real" current page has
-                // named metadata. This allows a parent page to control a inserted
-                // page through defining variables
-                //
-                WikiPage rpg = ((WikiContext)context).getRealPage();
-                if( rpg != null )
-                {
-                    Object metadata = rpg.getAttribute( varName );
-                    if( metadata != null )
-                        return metadata.toString();
-                }
+                Object metadata = pg.getAttribute( varName );
+                if( metadata != null )
+                    return metadata.toString();
+            }
+            //
+            // And the final straw part 2: see if the "real" current page has
+            // named metadata. This allows a parent page to control a inserted
+            // page through defining variables
+            //
+            WikiPage rpg = context.getRealPage();
+            if( rpg != null )
+            {
+                Object metadata = rpg.getAttribute( varName );
+                if( metadata != null )
+                    return metadata.toString();
             }
             
             //
@@ -368,16 +365,16 @@
      */
     private static class SystemVariables
     {
-        private WikiActionBean m_context;
+        private WikiContext m_context;
 
-        public SystemVariables(WikiActionBean context)
+        public SystemVariables(WikiContext context)
         {
             m_context=context;
         }
 
         public String getPagename()
         {
-            return (m_context instanceof WikiContext ? ((WikiContext)m_context).getPage().getName() : null);
+            return m_context.getPage().getName();
         }
 
         public String getApplicationname()

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/WikiContext.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/WikiContext.java?rev=720116&r1=720115&r2=720116&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/WikiContext.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/WikiContext.java Sun Nov 23 20:57:18 2008
@@ -20,27 +20,13 @@
  */
 package com.ecyrd.jspwiki;
 
-import java.io.IOException;
-import java.security.Permission;
 import java.security.Principal;
-import java.text.MessageFormat;
-import java.util.*;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
 
 import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.jsp.PageContext;
-import javax.servlet.jsp.el.ELException;
-
-import net.sourceforge.stripes.validation.Validate;
-
-import org.apache.log4j.Logger;
 
 import com.ecyrd.jspwiki.action.*;
-import com.ecyrd.jspwiki.auth.*;
-import com.ecyrd.jspwiki.auth.permissions.AllPermission;
-import com.ecyrd.jspwiki.i18n.InternationalizationManager;
-import com.ecyrd.jspwiki.tags.WikiTagBase;
-import com.ecyrd.jspwiki.preferences.Preferences;
 
 /**
  *  <p>Provides state information throughout the processing of a page.  A
@@ -66,24 +52,9 @@
  *
  *  @author Andrew R. Jaquith
  */
-public abstract class WikiContext extends AbstractActionBean
-    implements Cloneable
+public interface WikiContext
+    extends Cloneable
 {
-    private    WikiPage   m_page;
-    private    WikiPage   m_realPage;
-    private    WikiEngine m_engine;
-    private    String     m_template = "default";
-
-    private    HashMap<String,Object> m_variableMap = new HashMap<String,Object>();
-
-    /**
-     *  Stores the HttpServletRequest.  May be null, if the request did not
-     *  come from a servlet.
-     */
-    protected  HttpServletRequest m_request = null;
-
-    private    WikiSession m_session = null;
-
     /** User is administering JSPWiki (Install, SecurityConfig). */
     public static final String    INSTALL  = HandlerInfo.getHandlerInfo( InstallActionBean.class, "install" ).getRequestContext();
 
@@ -166,20 +137,7 @@
 
     /** User is doing administrative things. */
     public static final String    ADMIN    = "admin";
-
-    private static final Logger   log      = Logger.getLogger( WikiContext.class );
-
-    /**
-     * Creates a new WikiContext, without a WikiEngine, Request or WikiPage. This constructor should
-     * <em>never be called;</em> factory methods such as {@link WikiEngine#createContext(HttpServletRequest, String)}
-     * and {@link WikiActionBeanFactory#newActionBean(HttpServletRequest, HttpServletResponse, Class)} should
-     * be used instead.
-     */
-    public WikiContext()
-    {
-        super();
-    }
-
+ 
     /**
      *  Sets a reference to the real page whose content is currently being
      *  rendered.
@@ -199,12 +157,7 @@
      *  @since 2.3.14
      *  @see com.ecyrd.jspwiki.tags.InsertPageTag
      */
-    public WikiPage setRealPage( WikiPage page )
-    {
-        WikiPage old = m_realPage;
-        m_realPage = page;
-        return old;
-    }
+    public WikiPage setRealPage( WikiPage page );
 
     /**
      *  Gets a reference to the real page whose content is currently being rendered.
@@ -223,30 +176,21 @@
      *  @see com.ecyrd.jspwiki.tags.InsertPageTag
      *  @see com.ecyrd.jspwiki.parser.JSPWikiMarkupParser
      */
-    public WikiPage getRealPage()
-    {
-        return m_realPage;
-    }
+    public WikiPage getRealPage();
 
     /**
      *  Returns the handling engine.
      *
      *  @return The wikiengine owning this context.
      */
-    public WikiEngine getEngine()
-    {
-        return super.getEngine();
-    }
+    public WikiEngine getEngine();
 
     /**
      *  Returns the page that is being handled.
      *
      *  @return the page which was fetched.
      */
-    public WikiPage getPage()
-    {
-        return m_page;
-    }
+    public WikiPage getPage();
 
     /**
      *  Sets the page that is being handled.
@@ -254,43 +198,21 @@
      *  @param page The wikipage
      *  @since 2.1.37.
      */
-    @Validate(required = true)
-    public void setPage( WikiPage page )
-    {
-        m_page = page;
-        m_realPage = m_page;
-    }
+    public void setPage( WikiPage page );
 
     /**
      *  Returns the request context.
      *  @return The name of the request context (e.g. VIEW).
      */
-    public String getRequestContext()
-    {
-        return super.getRequestContext();
-    }
-
-    /**
-     * Sets the request context. See above for the different request contexts
-     * (VIEW, EDIT, etc.) This argument must correspond exactly to the value of
-     * a Stripes event handler method's
-     * {@link com.ecyrd.jspwiki.action.WikiRequestContext} annotation for the
-     * bean class. For event handlers that do not have an
-     * {@linkplain com.ecyrd.jspwiki.action.WikiRequestContext} annotation,
-     * callers can supply a request context value based on the bean class and
-     * the event name; see the
-     * {@link com.ecyrd.jspwiki.action.HandlerInfo#getRequestContext()}
-     * documentation for more details.
-     * 
-     * @param arg The request context (one of the predefined contexts.)
-     * @throws if the supplied request context does not correspond
-     * to a {@linkplain com.ecyrd.jspwiki.action.WikiRequestContext}
-     * annotation, or the automatically request context name
-     */
-    public void setRequestContext( String arg )
-    {
-        super.setRequestContext( arg );
-    }
+    public String getRequestContext();
+
+    /**
+     *  Sets the request context.  See above for the different
+     *  request contexts (VIEW, EDIT, etc.)
+     *
+     *  @param arg The request context (one of the predefined contexts.)
+     */
+    public void setRequestContext( String arg );
 
     /**
      *  Gets a previously set variable.
@@ -298,10 +220,7 @@
      *  @param key The variable name.
      *  @return The variable contents.
      */
-    public Object getVariable( String key )
-    {
-        return super.getVariable( key );
-    }
+    public Object getVariable( String key );
 
     /**
      *  Sets a variable.  The variable is valid while the WikiContext is valid,
@@ -311,10 +230,7 @@
      *  @param key The variable name.
      *  @param data The variable value.
      */
-    public void setVariable( String key, Object data )
-    {
-        super.setVariable( key, data );
-    }
+    public void setVariable( String key, Object data );
 
     /**
      *  This method will safely return any HTTP parameters that
@@ -327,10 +243,7 @@
      *  @param paramName Parameter name to look for.
      *  @return HTTP parameter, or null, if no such parameter existed.
      */
-    public String getHttpParameter( String paramName )
-    {
-        return super.getHttpParameter( paramName );
-    }
+    public String getHttpParameter( String paramName );
 
     /**
      *  If the request did originate from a HTTP request,
@@ -341,10 +254,7 @@
      *  @return Null, if no HTTP request was done.
      *  @since 2.0.13.
      */
-    public HttpServletRequest getHttpRequest()
-    {
-        return super.getHttpRequest();
-    }
+    public HttpServletRequest getHttpRequest();
 
     /**
      *  Sets the template to be used for this request.
@@ -352,29 +262,29 @@
      *  @param dir The template name
      *  @since 2.1.15.
      */
-    public void setTemplate( String dir )
-    {
-        super.setTemplate( dir );
-    }
+    public void setTemplate( String dir );
 
     /**
-     * Returns the name of the WikiPage associated with this wiki context.
-     * @return the page name
-     */
-    public String getName()
-    {
-        return m_page != null ? m_page.getName() : "<no page>";
-    }
+     * Returns the target of this wiki context: a page, group name or JSP. If
+     * the associated Command is a PageCommand, this method returns the page's
+     * name. Otherwise, this method delegates to the associated Command's
+     * {@link com.ecyrd.jspwiki.ui.Command#getName()} method. Calling classes
+     * can rely on the results of this method for looking up canonically-correct
+     * page or group names. Because it does not automatically assume that the
+     * wiki context is a PageCommand, calling this method is inherently safer
+     * than calling <code>getPage().getName()</code>.
+     * @return the name of the target of this wiki context
+     * @see com.ecyrd.jspwiki.ui.PageCommand#getName()
+     * @see com.ecyrd.jspwiki.ui.GroupCommand#getName()
+     */
+    public String getName();
 
     /**
      *  Gets the template that is to be used throughout this request.
      *  @since 2.1.15.
      *  @return template name
      */
-    public String getTemplate()
-    {
-        return super.getTemplate();
-    }
+    public String getTemplate();
 
     /**
      *  Convenience method that gets the current user. Delegates the
@@ -385,10 +295,7 @@
      *
      *  @return The current user; or maybe null in case of internal calls.
      */
-    public Principal getCurrentUser()
-    {
-        return super.getCurrentUser();
-    }
+    public Principal getCurrentUser();
 
     /**
      *  A shortcut to generate a VIEW url.
@@ -396,10 +303,7 @@
      *  @param page The page to which to link.
      *  @return An URL to the page.  This honours the current absolute/relative setting.
      */
-    public String getViewURL( String page )
-    {
-        return getURL( VIEW, page, null );
-    }
+    public String getViewURL( String page );
 
     /**
      *  Creates an URL for the given request context.
@@ -409,10 +313,7 @@
      *  @return An URL to the page, honours the absolute/relative setting in jspwiki.properties
      */
     public String getURL( String context,
-                          String page )
-    {
-        return getURL( context, page, null );
-    }
+                          String page );
 
     /**
      *  Returns an URL from a page. It this WikiContext instance was constructed
@@ -427,45 +328,15 @@
      */
     public String getURL( String context,
                           String page,
-                          String params )
-    {
-        boolean absolute = "absolute".equals( getEngine().getVariable( this, WikiEngine.PROP_REFSTYLE ) );
-
-        // FIXME: is rather slow
-        return getEngine().getURL( context,
-                                page,
-                                params,
-                                absolute );
-
-    }
-
+                          String params );
+    
     /**
      *  Returns a shallow clone of the WikiContext.
      *
      *  @since 2.1.37.
      *  @return A shallow clone of the WikiContext
      */
-    public Object clone()
-    {
-        try
-        {
-            // super.clone() must always be called to make sure that inherited objects
-            // get the right type
-            WikiContext copy = (WikiContext)super.clone();
-
-            copy.m_variableMap    = m_variableMap;
-            copy.m_page           = m_page;
-            copy.m_realPage       = m_realPage;
-            WikiActionBeanContext context = getContext();
-            copy.setContext( context );
-            String template = getTemplate();
-            copy.setTemplate( template );
-            return copy;
-        }
-        catch( CloneNotSupportedException e ){} // Never happens
-
-        return null;
-    }
+    public Object clone();
 
     /**
      *  Creates a deep clone of the WikiContext.  This is useful when you want
@@ -474,29 +345,7 @@
      *  @since  2.8.0
      *  @return A deep clone of the WikiContext.
      */
-    public WikiContext deepClone()
-    {
-        try
-        {
-            // super.clone() must always be called to make sure that inherited objects
-            // get the right type
-            WikiContext copy = (WikiContext)super.clone();
-
-            //  No need to deep clone these
-            copy.m_engine  = m_engine;
-
-            copy.m_template       = m_template;
-            copy.m_variableMap    = (HashMap<String,Object>)m_variableMap.clone();
-            copy.m_request        = m_request;
-            copy.m_session        = m_session;
-            copy.m_page           = (WikiPage)m_page.clone();
-            copy.m_realPage       = (WikiPage)m_realPage.clone();
-            return copy;
-        }
-        catch( CloneNotSupportedException e ){} // Never happens
-
-        return null;
-    }
+    public WikiContext deepClone();
     
     /**
      *  Returns the WikiSession associated with the context.
@@ -506,131 +355,7 @@
      *
      *  @return The WikiSession associate with this context.
      */
-    public WikiSession getWikiSession()
-    {
-        return super.getWikiSession();
-    }
-
-    /**
-     *  This method can be used to find the WikiContext programmatically
-     *  from a JSP PageContext. We check the request context. 
-     *  The wiki context, if it exists,
-     *  is looked up using the key
-     *  {@link com.ecyrd.jspwiki.tags.WikiTagBase#ATTR_CONTEXT}.
-     *
-     *  @since 2.4
-     *  @param pageContext the JSP page context
-     *  @return Current WikiContext, or null, of no context exists.
-     */
-    public static WikiContext findContext( PageContext pageContext )
-    {
-        HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
-        WikiContext context = (WikiContext)request.getAttribute( WikiTagBase.ATTR_CONTEXT );
-        return context;
-    }
-
-    /**
-     * Checks whether the current user has access to this wiki context,
-     * by obtaining the required Permission (see {@link HandlerInfo#getPermission(WikiActionBean)})
-     * and delegating the access check to
-     * {@link com.ecyrd.jspwiki.auth.AuthorizationManager#checkPermission(WikiSession, Permission)}.
-     * If the user is allowed, this method returns <code>true</code>;
-     * <code>false</code> otherwise. If access is allowed,
-     * the wiki context will be added to the request as an attribute
-     * with the key name {@link com.ecyrd.jspwiki.tags.WikiTagBase#ATTR_CONTEXT}.
-     * Note that this method will automatically redirect the user to
-     * a login or error page, as appropriate, if access fails. This is
-     * NOT guaranteed to be default behavior in the future.
-     * @param response the http response
-     * @return the result of the access check
-     * @throws IOException In case something goes wrong
-     * @deprecated callers should not need to call this method, and should rely on {@link WikiInterceptor} instead to control access
-     */
-    public boolean hasAccess( HttpServletResponse response ) throws IOException
-    {
-        return hasAccess( response, true );
-    }
-
-    /**
-     * Checks whether the current user has access to this wiki context (and
-     * optionally redirects if not), by obtaining the required Permission (see {@link HandlerInfo#getPermission(WikiActionBean)})
-     * and delegating the access check to
-     * {@link com.ecyrd.jspwiki.auth.AuthorizationManager#checkPermission(WikiSession, Permission)}.
-     * If the user is allowed, this method returns <code>true</code>;
-     * <code>false</code> otherwise. If access is allowed,
-     * the wiki context will be added to the request as attribute
-     * with the key name {@link com.ecyrd.jspwiki.tags.WikiTagBase#ATTR_CONTEXT}.
-     * Note: for 3.0, this method obtains the required permission by looking up its permission information
-     * by calling {@link com.ecyrd.jspwiki.action.HandlerInfo#getDefaultHandlerInfo(Class)}.
-     * The method that contains the {@link net.sourceforge.stripes.action.DefaultHandler} annotation
-     * is the one that will be used to determine the correct permission. If no method containing a
-     * DefaultHandler is found, this method returns <code>true</code>.
-     * @return the result of the access check
-     * @param response The servlet response object
-     * @param redirect If true, makes an automatic redirect to the response
-     * @throws IOException If something goes wrong
-     * @deprecated callers should not need to call this method, and should rely on {@link WikiInterceptor} instead to control access
-     */
-    public boolean hasAccess( HttpServletResponse response, boolean redirect ) throws IOException
-    {
-        // Look up the HandlerInfo for the current Stripes event handler
-        String eventMethod = getContext().getEventName();
-        HandlerInfo handlerInfo;
-        if ( eventMethod == null )
-        {
-            handlerInfo = HandlerInfo.getDefaultHandlerInfo( this.getClass() );
-        }
-        else
-        {
-            handlerInfo = HandlerInfo.getHandlerInfo( this.getClass(), eventMethod );
-        }
-        
-        // Get the required permission
-        Permission requiredPermission = null;
-        try
-        {
-            requiredPermission = handlerInfo.getPermission( this );
-        }
-        catch ( ELException e ) {
-            log.error( "Could not evaluate event handler permission for  " + this.getClass() + ", method=" + handlerInfo.getHandlerMethod().getName() );
-        }
-        
-        WikiSession wikiSession = getWikiSession();
-        AuthorizationManager mgr = getEngine().getAuthorizationManager();
-        boolean allowed = requiredPermission == null ? true : mgr.checkPermission( getWikiSession(), requiredPermission );
-        ResourceBundle rb = getBundle( InternationalizationManager.CORE_BUNDLE );
-
-        // Stash the wiki context
-        if( allowed )
-        {
-            if ( getContext().getRequest().getAttribute( WikiTagBase.ATTR_CONTEXT ) == null )
-            {
-                getContext().getRequest().setAttribute( WikiTagBase.ATTR_CONTEXT, this );
-            }
-        }
-
-        // If access not allowed, redirect
-        if( !allowed && redirect )
-        {
-            Principal currentUser  = wikiSession.getUserPrincipal();
-            Object[] arguments = { getName() };
-            if( wikiSession.isAuthenticated() )
-            {
-                log.info("User "+currentUser.getName()+" has no access - forbidden (permission=" + requiredPermission + ")" );
-                String pageurl = m_page.getName();
-                wikiSession.addMessage( MessageFormat.format( rb.getString("security.error.noaccess.logged"), arguments) );
-                response.sendRedirect( getEngine().getURL(WikiContext.LOGIN, pageurl, null, false ) );
-            }
-            else
-            {
-                log.info("User "+currentUser.getName()+" has no access - redirecting (permission=" + requiredPermission + ")");
-                String pageurl = m_page.getName();
-                wikiSession.addMessage( MessageFormat.format( rb.getString("security.error.noaccess"), arguments) );
-                response.sendRedirect( getEngine().getURL(WikiContext.LOGIN, pageurl, null, false ) );
-            }
-        }
-        return allowed;
-    }
+    public WikiSession getWikiSession();
 
     /**
      *  Returns true, if the current user has administrative permissions (i.e. the omnipotent
@@ -639,16 +364,7 @@
      *  @since 2.4.46
      *  @return true, if the user has all permissions.
      */
-    public boolean hasAdminPermissions()
-    {
-        boolean admin = false;
-
-        WikiEngine m_engine = getEngine();
-        admin = m_engine.getAuthorizationManager().checkPermission( getWikiSession(),
-                                                                    new AllPermission(m_engine.getApplicationName()) );
-
-        return admin;
-    }
+    public boolean hasAdminPermissions();
 
     /**
      *  Locates the i18n ResourceBundle given.  This method interprets
@@ -660,27 +376,6 @@
      *  @throws MissingResourceException If the bundle cannot be found
      */
     // FIXME: This method should really cache the ResourceBundles or something...
-    public ResourceBundle getBundle( String bundle ) throws MissingResourceException
-    {
-        return super.getBundle( bundle );
-    }
-
-    /**
-     *  Returns the locale of the HTTP request if available,
-     *  otherwise returns the default Locale of the server.
-     *
-     *  @return A valid locale object
-     *  @param context The WikiContext
-     *  @deprecated use {@link com.ecyrd.jspwiki.action.WikiActionBeanContext#getLocale()} instead
-     */
-    public static Locale getLocale( WikiContext context )
-    {
-        return context.getContext().getLocale();
-/*
-        HttpServletRequest request = context.getHttpRequest();
-        return ( request != null )
-                ? request.getLocale() : Locale.getDefault();
-*/
-    }
+    public ResourceBundle getBundle( String bundle ) throws MissingResourceException;
 
 }

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/WikiEngine.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/WikiEngine.java?rev=720116&r1=720115&r2=720116&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/WikiEngine.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/WikiEngine.java Sun Nov 23 20:57:18 2008
@@ -39,7 +39,7 @@
 import org.apache.log4j.PropertyConfigurator;
 
 import com.ecyrd.jspwiki.action.HandlerInfo;
-import com.ecyrd.jspwiki.action.WikiActionBean;
+import com.ecyrd.jspwiki.action.WikiActionBeanContext;
 import com.ecyrd.jspwiki.action.WikiActionBeanFactory;
 import com.ecyrd.jspwiki.attachment.Attachment;
 import com.ecyrd.jspwiki.attachment.AttachmentManager;
@@ -1472,7 +1472,7 @@
     {
         WikiPage page = getPage( pagename, version );
 
-        WikiContext context = m_beanFactory.newViewActionBean( null, null, page );
+        WikiContext context = m_beanFactory.newViewWikiContext( null, null, page );
 
         String res = getHTML( context, page );
 
@@ -1540,7 +1540,7 @@
     {
         LinkCollector localCollector = new LinkCollector();
 
-        textToHTML( m_beanFactory.newViewActionBean( null, null, page ),
+        textToHTML( m_beanFactory.newViewWikiContext( null, null, page ),
                     pagedata,
                     localCollector,
                     null,
@@ -2005,7 +2005,7 @@
      *  @return Variable value, or null, if there is no such variable.
      *  @since 2.2
      */
-    public String getVariable( WikiActionBean context, String name )
+    public String getVariable( WikiContext context, String name )
     {
         try
         {
@@ -2126,21 +2126,15 @@
             log.error( "No HandlerInfo found for request context '" + requestContext + "'! Check your annotations." );
             return null;
         }
-        Class<? extends WikiActionBean> beanClass = handler.getActionBeanClass();
         
         // Build the wiki context... dummy reply and response objects will be added by WikiActionBeanFactory
         try
         {
-            WikiActionBean actionBean = m_beanFactory.newActionBean( request, (HttpServletResponse)null, beanClass );
-            actionBean.getContext().setEventName( handler.getEventName() );
-            if ( actionBean instanceof WikiContext )
-            {
-                // Stash the action bean/wiki context, and return it!
-                WikiActionBeanFactory.saveActionBean( request, actionBean );
-                return (WikiContext)actionBean;
-            }
-            throw new IllegalArgumentException( "Context '" + requestContext + "' resolved to non-WikiContext action bean class! " +
-            		"Please use the <stripes:useActionBean> tag instead of WikiEngine.createContext()." );
+            WikiActionBeanContext context = m_beanFactory.newWikiContext( request, (HttpServletResponse)null, requestContext );
+            
+            // Stash the action bean/wiki context, and return it!
+            WikiActionBeanFactory.saveContext( request, context );
+            return context;
         }
         catch ( WikiException e )
         {

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/AbstractActionBean.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/AbstractActionBean.java?rev=720116&r1=720115&r2=720116&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/AbstractActionBean.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/AbstractActionBean.java Sun Nov 23 20:57:18 2008
@@ -1,17 +1,7 @@
 package com.ecyrd.jspwiki.action;
 
-import java.security.Principal;
-import java.util.*;
-
-import javax.servlet.http.HttpServletRequest;
-
 import net.sourceforge.stripes.action.ActionBeanContext;
 
-import com.ecyrd.jspwiki.WikiEngine;
-import com.ecyrd.jspwiki.WikiSession;
-import com.ecyrd.jspwiki.auth.WikiPrincipal;
-import com.ecyrd.jspwiki.preferences.Preferences;
-
 /**
  * <p>
  * Abstract ActionBean superclass for all wiki actions, such as page actions ({@link com.ecyrd.jspwiki.WikiContext}
@@ -23,20 +13,9 @@
  */
 public abstract class AbstractActionBean implements WikiActionBean
 {
-    protected Map<String, Object> m_variableMap = new HashMap<String, Object>();
-
     private WikiActionBeanContext m_actionBeanContext = null;
 
     /**
-     * The JSP for this WikiContext.
-     */
-    private String m_skin = null;
-
-    private String m_template = null;
-
-    private static final String DEFAULT_TEMPLATE = "default";
-
-    /**
      * Creates a new instance of this class, without a WikiEngine, Request or
      * WikiPage.
      */
@@ -58,140 +37,6 @@
     }
 
     /**
-     * Convenience method that gets the current user. Delegates the lookup to
-     * the WikiSession associated with this WikiContect. May return null, in
-     * case the current user has not yet been determined; or this is an internal
-     * system. If the WikiSession has not been set, <em>always</em> returns
-     * null.
-     */
-    public Principal getCurrentUser()
-    {
-        if( getWikiSession() == null )
-        {
-            // This shouldn't happen, really...
-            return WikiPrincipal.GUEST;
-        }
-        return getWikiSession().getUserPrincipal();
-    }
-
-    /**
-     * Returns the WikiEngine, which may be <code>null</code> if this instance
-     * was created without invoking the WikiActionBeanContext method
-     * {@link WikiActionBeanContext#setServletContext(javax.servlet.ServletContext)}.
-     */
-    public WikiEngine getEngine()
-    {
-        return getContext().getWikiEngine();
-    }
-
-    /**
-     * Returns the request context for this ActionBean by looking up the value
-     * of the annotation {@link WikiRequestContext} associated with the current
-     * event handler method for this ActionBean. The current event handler is
-     * obtained from {@link WikiActionBeanContext#getEventName()}. Note that if
-     * this ActionBean does not have a a current event handler assigned, or if
-     * the event handler method does not contain the WikiRequestContext
-     * annotation, this method will return
-     * {@link com.ecyrd.jspwiki.WikiContext#NONE}.
-     */
-    public String getRequestContext()
-    {
-        WikiActionBeanContext wac = getContext();
-        if( wac == null )
-        {
-            return "none";
-        }
-
-        String eventName = wac.getEventName();
-        if( eventName == null )
-        {
-            return "none";
-        }
-
-        return HandlerInfo.getHandlerInfo( this.getClass(), eventName ).getRequestContext();
-    }
-
-    /**
-     * Returns the "skin" to be used for this ActionBean.
-     * 
-     * @return the skin
-     */
-    public String getSkin()
-    {
-        return m_skin;
-    }
-
-    /**
-     * <p>
-     * Gets the template that is to be used throughout this request. The value
-     * returned depends on the whether the current HTTP request has supplied a
-     * custom skin or template name. In order of preference:
-     * </p>
-     * <ul>
-     * <li>The "skin", if set by {@link #setSkin(String)} or if the HTTP
-     * parameter <code>skin</code> was bound by Stripes</li>
-     * <li>The template, if set by {@link #setTemplate(String)} or if the HTTP
-     * parameter <code>template</code> was bound by Stripes</li>
-     * <li>The WikiEngine's default template, as returned by
-     * {@link WikiEngine#getTemplateDir()}</li>
-     * <li>The value <code>default</code></li>
-     * </ul>
-     * 
-     * @since 2.1.15.
-     */
-    public String getTemplate()
-    {
-        if( m_skin != null )
-        {
-            return m_skin;
-        }
-        else if( m_template != null )
-        {
-            return m_template;
-        }
-        else if( getEngine() != null )
-        {
-            return getEngine().getTemplateDir();
-        }
-        return DEFAULT_TEMPLATE;
-    }
-
-    /**
-     * Returns the WikiSession associated with the context. This method is
-     * guaranteed to always return a valid WikiSession. If this context was
-     * constructed without an associated HttpServletRequest, it will return
-     * {@link WikiSession#guestSession(WikiEngine)}.
-     */
-    public WikiSession getWikiSession()
-    {
-        return getContext().getWikiSession();
-    }
-
-    /**
-     * Gets a previously set variable.
-     * 
-     * @param key The variable name.
-     * @return The variable contents.
-     */
-    public Object getVariable( String key )
-    {
-        return m_variableMap.get( key );
-    }
-
-    /**
-     * Sets a variable. The variable is valid while the WikiContext is valid,
-     * i.e. while page processing continues. The variable data is discarded once
-     * the page processing is finished.
-     * 
-     * @param key The variable name.
-     * @param data The variable value.
-     */
-    public void setVariable( String key, Object data )
-    {
-        m_variableMap.put( key, data );
-    }
-
-    /**
      * Sets the Stripes ActionBeanContext associated with this WikiContext. It
      * will also update the cached HttpRequest.
      */
@@ -200,122 +45,4 @@
         m_actionBeanContext = ((WikiActionBeanContext) context);
     }
 
-    /**
-     * Sets the skin to be used with this ActionBean. This value will override
-     * the template returned by {@link #getTemplate()}. Normally, this method
-     * is invoked by Stripes when binding request parameters to the ActionBean.
-     * 
-     * @param skin the skin to use
-     */
-    public void setSkin( String skin )
-    {
-        m_skin = skin;
-    }
-
-    /**
-     * Sets the template to be used for this request.
-     * 
-     * @since 2.1.15.
-     */
-    public void setTemplate( String dir )
-    {
-        m_template = dir;
-    }
-
-    /**
-     * Locates the i18n ResourceBundle given. This method examines the Stripes
-     * ActionBeanContext and returns the current locale.
-     * 
-     * @see com.ecyrd.jspwiki.i18n.InternationalizationManager
-     * @param bundle The name of the bundle you are looking for.
-     * @return A resource bundle object
-     * @throws MissingResourceException If the bundle cannot be found
-     */
-    // FIXME: This method should really cache the ResourceBundles or
-    // something...
-    public ResourceBundle getBundle( String bundle ) throws MissingResourceException
-    {
-        if( m_actionBeanContext == null || m_actionBeanContext.getRequest() == null )
-        {
-            throw new IllegalStateException( "WikiActionBean did not have a valid ActionBeanContext or associated request." );
-        }
-
-        Locale loc = Preferences.getLocale( this );
-        
-        ResourceBundle b = getEngine().getInternationalizationManager().getBundle(bundle, loc);
-
-        return b;
-    }
-
-    // ------------------------------------ Deprecated methods we are
-    // reluctantly pulling up from WikiContext
-
-    /**
-     * If the request did originate from a HTTP request, then the HTTP request
-     * can be fetched here. However, it the request did NOT originate from a
-     * HTTP request, then this method will return null, and YOU SHOULD CHECK FOR
-     * IT!
-     * 
-     * @return Null, if no HTTP request was done.
-     * @deprecated use the method {@link #getContext()} to obtain the
-     *             ActionBeanContext, and call
-     *             {@link com.ecyrd.jspwiki.action.WikiActionBeanContext#getRequest()}
-     *             method.
-     * @since 2.0.13.
-     */
-    public HttpServletRequest getHttpRequest()
-    {
-        return getContext().getRequest();
-    }
-
-    /**
-     * This method will safely return any HTTP parameters that might have been
-     * defined. You should use this method instead of peeking directly into the
-     * result of getHttpRequest(), since this method is smart enough to do all
-     * of the right things, figure out UTF-8 encoded parameters, etc.
-     * 
-     * @since 2.0.13.
-     * @param paramName Parameter name to look for.
-     * @return HTTP parameter, or null, if no such parameter existed.
-     */
-    public String getHttpParameter( String paramName )
-    {
-        String result = null;
-
-        if( getContext() != null )
-        {
-            result = getContext().getRequest().getParameter( paramName );
-        }
-
-        return result;
-    }
-
-    /**
-     * Sets the request context. See above for the different request contexts
-     * (VIEW, EDIT, etc.) This argument must correspond exactly to the value of
-     * a Stripes event handler method's
-     * {@link com.ecyrd.jspwiki.action.WikiRequestContext} annotation for the
-     * bean class. For event handlers that do not have an
-     * {@linkplain com.ecyrd.jspwiki.action.WikiRequestContext} annotation,
-     * callers can supply a request context value based on the bean class and
-     * the event name; see the
-     * {@link com.ecyrd.jspwiki.action.HandlerInfo#getRequestContext()}
-     * documentation for more details.
-     * 
-     * @param arg The request context (one of the predefined contexts.)
-     * @throws IllegalArgumentException if the supplied request context does not
-     *             correspond to a
-     *             {@linkplain com.ecyrd.jspwiki.action.WikiRequestContext}
-     *             annotation, or the automatically request context name
-     */
-    public void setRequestContext( String arg )
-    {
-        HandlerInfo handler = HandlerInfo.getHandlerInfo( this.getClass(), arg );
-        if( getContext() == null )
-        {
-            throw new IllegalStateException( "WikiActionBean did not set a WikiActionBeanContext!" );
-        }
-        getContext().setEventName( handler.getEventName() );
-    }
-
 }

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/AdministerProfilesActionBean.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/AdministerProfilesActionBean.java?rev=720116&r1=720115&r2=720116&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/AdministerProfilesActionBean.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/AdministerProfilesActionBean.java Sun Nov 23 20:57:18 2008
@@ -58,7 +58,7 @@
     @WikiRequestContext("adminProfiles")
     public Resolution saveChanges() throws WikiSecurityException
     {
-        UserDatabase db = super.getContext().getWikiEngine().getUserManager().getUserDatabase();
+        UserDatabase db = super.getContext().getEngine().getUserManager().getUserDatabase();
 
         // Apply any changes to existing profiles (and create new ones)
         for( UserProfile profile : m_profiles )
@@ -72,7 +72,7 @@
             }
             catch( NoSuchPrincipalException e )
             {
-                existingProfile = this.getEngine().getUserManager().getUserDatabase().newProfile();
+                existingProfile = this.getContext().getEngine().getUserManager().getUserDatabase().newProfile();
             }
 
             // Make changes to things that have changed

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/AttachActionBean.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/AttachActionBean.java?rev=720116&r1=720115&r2=720116&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/AttachActionBean.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/AttachActionBean.java Sun Nov 23 20:57:18 2008
@@ -5,12 +5,11 @@
 import net.sourceforge.stripes.action.Resolution;
 import net.sourceforge.stripes.action.UrlBinding;
 
-import com.ecyrd.jspwiki.WikiContext;
 import com.ecyrd.jspwiki.attachment.Attachment;
 import com.ecyrd.jspwiki.auth.permissions.PagePermission;
 
 @UrlBinding("/attach/{page}/{attachment}")
-public class AttachActionBean extends WikiContext
+public class AttachActionBean extends AbstractActionBean
 {
     private Attachment m_attachment;
     

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/CommentActionBean.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/CommentActionBean.java?rev=720116&r1=720115&r2=720116&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/CommentActionBean.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/CommentActionBean.java Sun Nov 23 20:57:18 2008
@@ -4,11 +4,10 @@
 import net.sourceforge.stripes.action.Resolution;
 import net.sourceforge.stripes.action.UrlBinding;
 
-import com.ecyrd.jspwiki.WikiContext;
 import com.ecyrd.jspwiki.auth.permissions.PagePermission;
 
 @UrlBinding("/Comment.jsp")
-public class CommentActionBean extends WikiContext
+public class CommentActionBean extends AbstractActionBean
 {
     @HandlesEvent("comment")
     @HandlerPermission(permissionClass=PagePermission.class, target="${page.name}", actions=PagePermission.COMMENT_ACTION)

Added: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/DefaultWikiContext.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/DefaultWikiContext.java?rev=720116&view=auto
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/DefaultWikiContext.java (added)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/DefaultWikiContext.java Sun Nov 23 20:57:18 2008
@@ -0,0 +1,490 @@
+/*
+    JSPWiki - a JSP-based WikiWiki clone.
+
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.    
+ */
+package com.ecyrd.jspwiki.action;
+
+import java.security.Principal;
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.log4j.Logger;
+
+import com.ecyrd.jspwiki.WikiContext;
+import com.ecyrd.jspwiki.WikiEngine;
+import com.ecyrd.jspwiki.WikiPage;
+import com.ecyrd.jspwiki.WikiSession;
+import com.ecyrd.jspwiki.auth.WikiPrincipal;
+import com.ecyrd.jspwiki.auth.permissions.AllPermission;
+import com.ecyrd.jspwiki.preferences.Preferences;
+
+/**
+ * <p>
+ * Default implementation of {@link com.ecyrd.jspwiki.WikiContext}.
+ * </p>
+ * 
+ * @author Andrew R. Jaquith
+ * @since 3.0
+ */
+public class DefaultWikiContext implements WikiContext
+{
+    private static final Logger log = Logger.getLogger( DefaultWikiContext.class );
+
+    private WikiPage m_page;
+
+    private WikiPage m_realPage;
+
+    private WikiEngine m_engine;
+
+    private String m_template = "default";
+
+    private HashMap<String, Object> m_variableMap = new HashMap<String, Object>();
+
+    private String m_requestContext = null;
+
+    private WikiSession m_session = null;
+
+    /**
+     * Stores the HttpServletRequest. May be null, if the request did not come
+     * from a servlet.
+     */
+    protected HttpServletRequest m_request = null;
+
+    /**
+     * Returns a shallow clone of the WikiContext.
+     * 
+     * @since 2.1.37.
+     * @return A shallow clone of the WikiContext
+     */
+    public Object clone()
+    {
+        try
+        {
+            // super.clone() must always be called to make sure that inherited
+            // objects
+            // get the right type
+            DefaultWikiContext copy = (DefaultWikiContext) super.clone();
+
+            copy.m_engine = m_engine;
+
+            copy.m_template = m_template;
+            copy.m_variableMap = m_variableMap;
+            copy.m_request = m_request;
+            copy.m_session = m_session;
+            copy.m_page = m_page;
+            copy.m_realPage = m_realPage;
+            return copy;
+        }
+        catch( CloneNotSupportedException e )
+        {
+        } // Never happens
+
+        return null;
+    }
+
+    /**
+     * Creates a deep clone of the WikiContext. This is useful when you want to
+     * be sure that you don't accidentally mess with page attributes, etc.
+     * 
+     * @since 2.8.0
+     * @return A deep clone of the WikiContext.
+     */
+    public WikiContext deepClone()
+    {
+        try
+        {
+            // super.clone() must always be called to make sure that inherited
+            // objects
+            // get the right type
+            DefaultWikiContext copy = (DefaultWikiContext) super.clone();
+
+            // No need to deep clone these
+            copy.m_engine = m_engine;
+
+            copy.m_template = m_template;
+            copy.m_variableMap = (HashMap<String, Object>) m_variableMap.clone();
+            copy.m_request = m_request;
+            copy.m_session = m_session;
+            copy.m_page = (WikiPage) m_page.clone();
+            copy.m_realPage = (WikiPage) m_realPage.clone();
+            return copy;
+        }
+        catch( CloneNotSupportedException e )
+        {
+        } // Never happens
+
+        return null;
+    }
+
+    /**
+     * Locates the i18n ResourceBundle given. This method interprets the request
+     * locale, and uses that to figure out which language the user wants.
+     * 
+     * @see com.ecyrd.jspwiki.i18n.InternationalizationManager
+     * @param bundle The name of the bundle you are looking for.
+     * @return A resource bundle object
+     * @throws MissingResourceException If the bundle cannot be found
+     */
+    // FIXME: This method should really cache the ResourceBundles or
+    // something...
+    public ResourceBundle getBundle( String bundle ) throws MissingResourceException
+    {
+        Locale loc = Preferences.getLocale( this );
+
+        ResourceBundle b = m_engine.getInternationalizationManager().getBundle( bundle, loc );
+
+        return b;
+    }
+
+    /**
+     * Convenience method that gets the current user. Delegates the lookup to
+     * the WikiSession associated with this WikiContect. May return null, in
+     * case the current user has not yet been determined; or this is an internal
+     * system. If the WikiSession has not been set, <em>always</em> returns
+     * null.
+     * 
+     * @return The current user; or maybe null in case of internal calls.
+     */
+    public Principal getCurrentUser()
+    {
+        if( m_session == null )
+        {
+            // This shouldn't happen, really...
+            return WikiPrincipal.GUEST;
+        }
+        return m_session.getUserPrincipal();
+    }
+
+    /**
+     * Returns the handling engine.
+     * 
+     * @return The wikiengine owning this context.
+     */
+    public WikiEngine getEngine()
+    {
+        return m_engine;
+    }
+
+    /**
+     * This method will safely return any HTTP parameters that might have been
+     * defined. You should use this method instead of peeking directly into the
+     * result of getHttpRequest(), since this method is smart enough to do all
+     * of the right things, figure out UTF-8 encoded parameters, etc.
+     * 
+     * @since 2.0.13.
+     * @param paramName Parameter name to look for.
+     * @return HTTP parameter, or null, if no such parameter existed.
+     */
+    public String getHttpParameter( String paramName )
+    {
+        String result = null;
+
+        if( m_request != null )
+        {
+            result = m_request.getParameter( paramName );
+        }
+
+        return result;
+    }
+
+    /**
+     * If the request did originate from a HTTP request, then the HTTP request
+     * can be fetched here. However, it the request did NOT originate from a
+     * HTTP request, then this method will return null, and YOU SHOULD CHECK FOR
+     * IT!
+     * 
+     * @return Null, if no HTTP request was done.
+     * @since 2.0.13.
+     */
+    public HttpServletRequest getHttpRequest()
+    {
+        return m_request;
+    }
+
+    /**
+     * Returns the target of this wiki context: a page, group name or JSP. If
+     * the associated Command is a PageCommand, this method returns the page's
+     * name. Otherwise, this method delegates to the associated Command's
+     * {@link com.ecyrd.jspwiki.ui.Command#getName()} method. Calling classes
+     * can rely on the results of this method for looking up canonically-correct
+     * page or group names. Because it does not automatically assume that the
+     * wiki context is a PageCommand, calling this method is inherently safer
+     * than calling <code>getPage().getName()</code>.
+     * 
+     * @return the name of the target of this wiki context
+     * @see com.ecyrd.jspwiki.ui.PageCommand#getName()
+     * @see com.ecyrd.jspwiki.ui.GroupCommand#getName()
+     */
+    public String getName()
+    {
+        return m_page != null ? m_page.getName() : "<no page>";
+    }
+
+    /**
+     * Returns the page that is being handled.
+     * 
+     * @return the page which was fetched.
+     */
+    public WikiPage getPage()
+    {
+        return m_page;
+    }
+
+    /**
+     * Gets a reference to the real page whose content is currently being
+     * rendered. If your plugin e.g. does some variable setting, be aware that
+     * if it is embedded in the LeftMenu or some other page added with
+     * InsertPageTag, you should consider what you want to do - do you wish to
+     * really reference the "master" page or the included page.
+     * <p>
+     * For example, in the default template, there is a page called "LeftMenu".
+     * Whenever you access a page, e.g. "Main", the master page will be Main,
+     * and that's what the getPage() will return - regardless of whether your
+     * plugin resides on the LeftMenu or on the Main page. However,
+     * getRealPage() will return "LeftMenu".
+     * 
+     * @return A reference to the real page.
+     * @see com.ecyrd.jspwiki.tags.InsertPageTag
+     * @see com.ecyrd.jspwiki.parser.JSPWikiMarkupParser
+     */
+    public WikiPage getRealPage()
+    {
+        return m_realPage;
+    }
+
+    /**
+     * Returns the request context.
+     * 
+     * @return The name of the request context (e.g. VIEW).
+     */
+    public String getRequestContext()
+    {
+        return m_requestContext;
+    }
+
+    /**
+     * Gets the template that is to be used throughout this request.
+     * 
+     * @since 2.1.15.
+     * @return template name
+     */
+    public String getTemplate()
+    {
+        return m_template;
+    }
+
+    /**
+     * Creates an URL for the given request context.
+     * 
+     * @param context e.g. WikiContext.EDIT
+     * @param page The page to which to link
+     * @return An URL to the page, honours the absolute/relative setting in
+     *         jspwiki.properties
+     */
+    public String getURL( String context, String page )
+    {
+        return getURL( context, page, null );
+    }
+
+    /**
+     * Returns an URL from a page. It this WikiContext instance was constructed
+     * with an actual HttpServletRequest, we will attempt to construct the URL
+     * using HttpUtil, which preserves the HTTPS portion if it was used.
+     * 
+     * @param context The request context (e.g. WikiContext.UPLOAD)
+     * @param page The page to which to link
+     * @param params A list of parameters, separated with "&amp;"
+     * @return An URL to the given context and page.
+     */
+    public String getURL( String context, String page, String params )
+    {
+        boolean absolute = "absolute".equals( m_engine.getVariable( this, WikiEngine.PROP_REFSTYLE ) );
+
+        // FIXME: is rather slow
+        return m_engine.getURL( context, page, params, absolute );
+
+    }
+
+    /**
+     * Gets a previously set variable.
+     * 
+     * @param key The variable name.
+     * @return The variable contents.
+     */
+    public Object getVariable( String key )
+    {
+        return m_variableMap.get( key );
+    }
+
+    /**
+     * A shortcut to generate a VIEW url.
+     * 
+     * @param page The page to which to link.
+     * @return An URL to the page. This honours the current absolute/relative
+     *         setting.
+     */
+    public String getViewURL( String page )
+    {
+        return getURL( VIEW, page, null );
+    }
+
+    /**
+     * Returns the WikiSession associated with the context. This method is
+     * guaranteed to always return a valid WikiSession. If this context was
+     * constructed without an associated HttpServletRequest, it will return
+     * {@link WikiSession#guestSession(WikiEngine)}.
+     * 
+     * @return The WikiSession associate with this context.
+     */
+    public WikiSession getWikiSession()
+    {
+        return m_session;
+    }
+
+    /**
+     * Returns true, if the current user has administrative permissions (i.e.
+     * the omnipotent AllPermission).
+     * 
+     * @since 2.4.46
+     * @return true, if the user has all permissions.
+     */
+    public boolean hasAdminPermissions()
+    {
+        boolean admin = false;
+
+        WikiEngine m_engine = getEngine();
+        admin = m_engine.getAuthorizationManager().checkPermission( getWikiSession(),
+                                                                    new AllPermission( m_engine.getApplicationName() ) );
+
+        return admin;
+    }
+
+    /**
+     * Sets the page that is being handled. If the "real page" is <code>null</code>, it is
+     * set to the same value also.
+     * 
+     * @param page The wikipage
+     * @since 2.1.37.
+     */
+    public void setPage( WikiPage page )
+    {
+        m_page = page;
+        if ( m_realPage == null )
+        {
+            m_realPage = page;
+        }
+    }
+
+    /**
+     * Sets a reference to the real page whose content is currently being
+     * rendered.
+     * <p>
+     * Sometimes you may want to render the page using some other page's
+     * context. In those cases, it is highly recommended that you set the
+     * setRealPage() to point at the real page you are rendering. Please see
+     * InsertPageTag for an example.
+     * <p>
+     * Also, if your plugin e.g. does some variable setting, be aware that if it
+     * is embedded in the LeftMenu or some other page added with InsertPageTag,
+     * you should consider what you want to do - do you wish to really reference
+     * the "master" page or the included page.
+     * 
+     * @param page The real page which is being rendered.
+     * @return The previous real page
+     * @since 2.3.14
+     * @see com.ecyrd.jspwiki.tags.InsertPageTag
+     */
+    public WikiPage setRealPage( WikiPage page )
+    {
+        WikiPage old = m_realPage;
+        m_realPage = page;
+        return old;
+    }
+
+    /**
+     * Sets the request context. See above for the different request contexts
+     * (VIEW, EDIT, etc.)
+     * 
+     * @param arg The request context (one of the predefined contexts.)
+     * @throws IllegalStateException if the WikiEngine for this WikiContext has
+     *             not been previously set
+     */
+    public void setRequestContext( String arg )
+    {
+        m_requestContext = arg;
+    }
+
+    /**
+     * Sets the template to be used for this request.
+     * 
+     * @param dir The template name
+     * @since 2.1.15.
+     */
+    public void setTemplate( String dir )
+    {
+        m_template = dir;
+    }
+
+    /**
+     * Sets a variable. The variable is valid while the WikiContext is valid,
+     * i.e. while page processing continues. The variable data is discarded once
+     * the page processing is finished.
+     * 
+     * @param key The variable name.
+     * @param data The variable value.
+     */
+    public void setVariable( String key, Object data )
+    {
+        m_variableMap.put( key, data );
+    }
+
+    /**
+     * Sets the WikiEngine for this WikiContext. This method <em>must</em> be called
+     * as soon as possible after instantiation.
+     * @param engine the WikiEngine
+     */
+    protected void setEngine( WikiEngine engine )
+    {
+        m_engine = engine;
+    }
+    
+    /**
+     * Sets the HttpServletRequest for this WikiContext. This method <em>must</em> be called
+     * as soon as possible after instantiation.
+     * @param request the HTTP request object
+     */
+    protected void setHttpRequest( HttpServletRequest request )
+    {
+        m_request = request;
+    }
+
+    /**
+     * Sets the WikiSession for this WikiContext. This method <em>must</em> be called
+     * as soon as possible after instantiation.
+     * @param wikiSession the WikiSession
+     */
+    protected void setWikiSession( WikiSession wikiSession )
+    {
+        m_session = wikiSession;
+    }
+}

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/DeleteActionBean.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/DeleteActionBean.java?rev=720116&r1=720115&r2=720116&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/DeleteActionBean.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/DeleteActionBean.java Sun Nov 23 20:57:18 2008
@@ -4,11 +4,10 @@
 import net.sourceforge.stripes.action.Resolution;
 import net.sourceforge.stripes.action.UrlBinding;
 
-import com.ecyrd.jspwiki.WikiContext;
 import com.ecyrd.jspwiki.auth.permissions.PagePermission;
 
 @UrlBinding("/Delete.jsp")
-public class DeleteActionBean extends WikiContext
+public class DeleteActionBean extends AbstractActionBean
 {
     @HandlesEvent("delete")
     @HandlerPermission(permissionClass=PagePermission.class, target="${page.name}", actions=PagePermission.DELETE_ACTION)

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/EditActionBean.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/EditActionBean.java?rev=720116&r1=720115&r2=720116&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/EditActionBean.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/EditActionBean.java Sun Nov 23 20:57:18 2008
@@ -2,11 +2,10 @@
 
 import net.sourceforge.stripes.action.*;
 
-import com.ecyrd.jspwiki.WikiContext;
 import com.ecyrd.jspwiki.auth.permissions.PagePermission;
 
 @UrlBinding("/Edit.jsp")
-public class EditActionBean extends WikiContext
+public class EditActionBean extends AbstractActionBean
 {
     @DefaultHandler
     @HandlesEvent("edit")

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/GroupActionBean.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/GroupActionBean.java?rev=720116&r1=720115&r2=720116&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/GroupActionBean.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/GroupActionBean.java Sun Nov 23 20:57:18 2008
@@ -16,7 +16,7 @@
 import com.ecyrd.jspwiki.auth.permissions.GroupPermission;
 import com.ecyrd.jspwiki.auth.permissions.WikiPermission;
 
-@UrlBinding( "/Group.jsp" )
+@UrlBinding( "/Group.action" )
 public class GroupActionBean extends AbstractActionBean
 {
     private Group m_group = null;
@@ -93,7 +93,7 @@
     {
         try
         {
-            WikiEngine engine = getEngine();
+            WikiEngine engine = getContext().getEngine();
             GroupManager groupMgr = engine.getGroupManager();
             groupMgr.removeGroup( m_group.getName() );
         }
@@ -109,7 +109,7 @@
     @WikiRequestContext( "editGroup" )
     public Resolution save() throws WikiSecurityException
     {
-        GroupManager mgr = getContext().getWikiEngine().getGroupManager();
+        GroupManager mgr = getContext().getEngine().getGroupManager();
         mgr.setGroup( getContext().getWikiSession(), m_group );
         RedirectResolution r = new RedirectResolution( "/Group.jsp" );
         r.addParameter( "group", m_group.getName() );

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/InstallActionBean.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/InstallActionBean.java?rev=720116&r1=720115&r2=720116&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/InstallActionBean.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/InstallActionBean.java Sun Nov 23 20:57:18 2008
@@ -18,7 +18,7 @@
     {
         // See if admin users exists
         Permission perm = null;
-        WikiEngine engine = getContext().getWikiEngine();
+        WikiEngine engine = getContext().getEngine();
         try
         {
             UserManager userMgr = engine.getUserManager();

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/LoginActionBean.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/LoginActionBean.java?rev=720116&r1=720115&r2=720116&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/LoginActionBean.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/LoginActionBean.java Sun Nov 23 20:57:18 2008
@@ -38,13 +38,13 @@
     private Resolution saveCookiesAndRedirect( String pageName, boolean rememberMe )
     {
         // Set user cookie
-        Principal principal = getWikiSession().getUserPrincipal();
+        Principal principal = getContext().getWikiSession().getUserPrincipal();
         CookieAssertionLoginModule.setUserCookie( getContext().getResponse(), principal.getName() );
 
         // Set "remember me?" cookie
         if( rememberMe )
         {
-            CookieAuthenticationLoginModule.setLoginCookie( getEngine(), getContext().getResponse(), principal.getName() );
+            CookieAuthenticationLoginModule.setLoginCookie( getContext().getEngine(), getContext().getResponse(), principal.getName() );
         }
 
         UrlBuilder builder = new UrlBuilder( getContext().getLocale(), ViewActionBean.class, false );
@@ -84,17 +84,17 @@
     }
 
     @HandlesEvent( "login" )
-    @HandlerPermission( permissionClass = WikiPermission.class, target = "${engine.applicationName}", actions = WikiPermission.LOGIN_ACTION )
+    @HandlerPermission( permissionClass = WikiPermission.class, target = "${context.engine.applicationName}", actions = WikiPermission.LOGIN_ACTION )
     public Resolution login()
     {
-        WikiSession wikiSession = this.getWikiSession();
+        WikiSession wikiSession = getContext().getWikiSession();
         ValidationErrors errors = getContext().getValidationErrors();
-        ResourceBundle rb = getBundle( "CoreResources" );
+        ResourceBundle rb = getContext().getBundle( "CoreResources" );
 
         // If user got here and is already authenticated, it means
         // they just aren't allowed access to what they asked for.
         // Weepy tears and hankies all 'round.
-        if( getWikiSession().isAuthenticated() )
+        if( getContext().getWikiSession().isAuthenticated() )
         {
             errors.addGlobalError( new SimpleError( rb.getString( "login.error.noaccess" ) ) );
             getContext().flash( this );
@@ -107,7 +107,7 @@
         Resolution r = null;
         try
         {
-            if( getEngine().getAuthenticationManager().login( wikiSession, m_username, m_password ) )
+            if( getContext().getEngine().getAuthenticationManager().login( wikiSession, m_username, m_password ) )
             {
                 // Set cookies as needed and redirect
                 log.info( "Successfully authenticated user " + m_username + " (custom auth)" );
@@ -137,11 +137,11 @@
     }
 
     @HandlesEvent( "logout" )
-    @HandlerPermission( permissionClass = WikiPermission.class, target = "${engine.applicationName}", actions = WikiPermission.LOGIN_ACTION )
+    @HandlerPermission( permissionClass = WikiPermission.class, target = "${context.engine.applicationName}", actions = WikiPermission.LOGIN_ACTION )
     @WikiRequestContext( "logout" )
     public Resolution logout()
     {
-        WikiEngine engine = getEngine();
+        WikiEngine engine = getContext().getEngine();
         HttpServletRequest request = getContext().getRequest();
         HttpServletResponse response = getContext().getResponse();
         engine.getAuthenticationManager().logout( request );
@@ -178,7 +178,7 @@
     public void setRedirect( String redirect )
     {
         m_redirect = redirect;
-        setVariable( "redirect", redirect );
+        getContext().setVariable( "redirect", redirect );
     }
 
     /**
@@ -190,19 +190,19 @@
      */
     @DefaultHandler
     @HandlesEvent( "view" )
-    @HandlerPermission( permissionClass = WikiPermission.class, target = "${engine.applicationName}", actions = WikiPermission.LOGIN_ACTION )
+    @HandlerPermission( permissionClass = WikiPermission.class, target = "${context.engine.applicationName}", actions = WikiPermission.LOGIN_ACTION )
     @WikiRequestContext( "login" )
     public Resolution view()
     {
         Resolution r = null;
 
-        if( getWikiSession().isAuthenticated() )
+        if( getContext().getWikiSession().isAuthenticated() )
         {
             // Set cookies as needed and redirect
             r = saveCookiesAndRedirect( m_redirect, m_remember );
         }
 
-        if( getEngine().getAuthenticationManager().isContainerAuthenticated() )
+        if( getContext().getEngine().getAuthenticationManager().isContainerAuthenticated() )
         {
             //
             // Have we already been submitted? If yes, then we can assume that
@@ -213,7 +213,7 @@
             Object seen = session.getAttribute( "_redirect" );
             if( seen != null )
             {
-                ResourceBundle rb = getBundle( "CoreResources" );
+                ResourceBundle rb = getContext().getBundle( "CoreResources" );
                 getContext().getValidationErrors().addGlobalError( new SimpleError( rb.getString( "login.error.noaccess" ) ) );
                 getContext().flash( this );
                 return new RedirectResolution( MessageActionBean.class );
@@ -227,7 +227,7 @@
             // the user already. All we do is simply record that fact.
             // Nice and easy.
 
-            Principal user = getWikiSession().getLoginPrincipal();
+            Principal user = getContext().getWikiSession().getLoginPrincipal();
             log.info( "Successfully authenticated user " + user.getName() + " (container auth)" );
         }
 

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/NewBlogEntryActionBean.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/NewBlogEntryActionBean.java?rev=720116&r1=720115&r2=720116&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/NewBlogEntryActionBean.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/NewBlogEntryActionBean.java Sun Nov 23 20:57:18 2008
@@ -4,11 +4,10 @@
 import net.sourceforge.stripes.action.Resolution;
 import net.sourceforge.stripes.action.UrlBinding;
 
-import com.ecyrd.jspwiki.WikiContext;
 import com.ecyrd.jspwiki.auth.permissions.WikiPermission;
 
 @UrlBinding("/NewBlogEntry.jsp")
-public class NewBlogEntryActionBean extends WikiContext
+public class NewBlogEntryActionBean extends AbstractActionBean
 {
     @HandlesEvent("create")
     @HandlerPermission(permissionClass=WikiPermission.class, target="${engine.applicationName}", actions=WikiPermission.CREATE_PAGES_ACTION)

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/NewPageActionBean.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/NewPageActionBean.java?rev=720116&r1=720115&r2=720116&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/NewPageActionBean.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/NewPageActionBean.java Sun Nov 23 20:57:18 2008
@@ -4,11 +4,10 @@
 import net.sourceforge.stripes.action.Resolution;
 import net.sourceforge.stripes.action.UrlBinding;
 
-import com.ecyrd.jspwiki.WikiContext;
 import com.ecyrd.jspwiki.auth.permissions.WikiPermission;
 
 @UrlBinding("/NewPage.jsp")
-public class NewPageActionBean extends WikiContext
+public class NewPageActionBean extends AbstractActionBean
 {
     @WikiRequestContext("newPage")
     @HandlesEvent("create")

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/NoneActionBean.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/NoneActionBean.java?rev=720116&r1=720115&r2=720116&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/NoneActionBean.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/NoneActionBean.java Sun Nov 23 20:57:18 2008
@@ -4,8 +4,6 @@
 import net.sourceforge.stripes.action.HandlesEvent;
 import net.sourceforge.stripes.action.Resolution;
 
-import com.ecyrd.jspwiki.WikiContext;
-
 /**
  * Represents a dummy WikiContext that doesn't bind to a URL, and doesn't
  * contain any embedded logic. When the NoneActionBean class is passed as a
@@ -14,7 +12,7 @@
  * 
  * @author Andrew Jaquith
  */
-public class NoneActionBean extends WikiContext
+public class NoneActionBean extends AbstractActionBean
 {
     @DefaultHandler
     @HandlesEvent( "none" )

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/PageInfoActionBean.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/PageInfoActionBean.java?rev=720116&r1=720115&r2=720116&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/PageInfoActionBean.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/PageInfoActionBean.java Sun Nov 23 20:57:18 2008
@@ -5,11 +5,10 @@
 import net.sourceforge.stripes.action.Resolution;
 import net.sourceforge.stripes.action.UrlBinding;
 
-import com.ecyrd.jspwiki.WikiContext;
 import com.ecyrd.jspwiki.auth.permissions.PagePermission;
 
 @UrlBinding("/PageInfo.jsp")
-public class PageInfoActionBean extends WikiContext
+public class PageInfoActionBean extends AbstractActionBean
 {
     @DefaultHandler
     @HandlesEvent("info")

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/PageModifiedActionBean.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/PageModifiedActionBean.java?rev=720116&r1=720115&r2=720116&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/PageModifiedActionBean.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/PageModifiedActionBean.java Sun Nov 23 20:57:18 2008
@@ -4,11 +4,10 @@
 import net.sourceforge.stripes.action.Resolution;
 import net.sourceforge.stripes.action.UrlBinding;
 
-import com.ecyrd.jspwiki.WikiContext;
 import com.ecyrd.jspwiki.auth.permissions.PagePermission;
 
 @UrlBinding( "/PageModified.jsp" )
-public class PageModifiedActionBean extends WikiContext
+public class PageModifiedActionBean extends AbstractActionBean
 {
     @HandlesEvent( "conflict" )
     @HandlerPermission( permissionClass = PagePermission.class, target = "${page.name}", actions = PagePermission.VIEW_ACTION )