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/02/23 20:08:48 UTC

svn commit: r630508 - in /incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki: auth/permissions/ dav/ dav/items/ diff/ filters/ forms/

Author: ajaquith
Date: Sat Feb 23 11:08:45 2008
New Revision: 630508

URL: http://svn.apache.org/viewvc?rev=630508&view=rev
Log:
Initial Stripes component commit.

Modified:
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/auth/permissions/PermissionFactory.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/dav/AttachmentDavProvider.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/dav/HTMLPagesDavProvider.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/dav/RawPagesDavProvider.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/dav/WikiRootProvider.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/PingWeblogsComFilter.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/forms/FormOpen.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/forms/FormOutput.java

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/auth/permissions/PermissionFactory.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/auth/permissions/PermissionFactory.java?rev=630508&r1=630507&r2=630508&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/auth/permissions/PermissionFactory.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/auth/permissions/PermissionFactory.java Sat Feb 23 11:08:45 2008
@@ -19,6 +19,9 @@
  */
 package com.ecyrd.jspwiki.auth.permissions;
 
+import java.security.Permission;
+import java.util.HashMap;
+import java.util.Map;
 import java.util.WeakHashMap;
 
 import com.ecyrd.jspwiki.WikiPage;
@@ -37,7 +40,32 @@
      *  This is a WeakHashMap<Integer,PagePermission>, which stores the
      *  cached page permissions.
      */
-    private static WeakHashMap c_cache = new WeakHashMap();
+    private static Map<Class<? extends Permission>,Map<Integer,Permission>> c_cache 
+         = new HashMap<Class<? extends Permission>,Map<Integer,Permission>>();
+    
+    /**
+     *  Get a permission object for a Group and a set of actions.
+     *  
+     *  @param group the fully-qualified name of the group
+     *  @param actions A list of actions.
+     *  @return A GroupPermission object, presenting this group+actions combination.
+     */
+    public static final GroupPermission getGroupPermission( String group, String actions )
+    {
+        Map<Integer,Permission> cachedPerms = getPermissionCache( GroupPermission.class );
+        Integer key = new Integer( group.hashCode() ^ actions.hashCode() );
+        GroupPermission perm;
+        synchronized( cachedPerms )
+        {
+            perm = (GroupPermission)cachedPerms.get( key );
+            if( perm == null )
+            {
+                perm = new GroupPermission( group, actions );
+                cachedPerms.put( key, perm );
+            }
+        }
+        return perm;
+    }
     
     /**
      *  Get a permission object for a WikiPage and a set of actions.
@@ -48,19 +76,43 @@
      */
     public static final PagePermission getPagePermission( WikiPage page, String actions )
     {
-        return getPagePermission( page.getWiki(), page.getName(), actions );
+        Map<Integer,Permission> cachedPerms = getPermissionCache( GroupPermission.class );
+        Integer key = new Integer( page.getWiki().hashCode() ^ page.getName().hashCode() ^ actions.hashCode() );
+        PagePermission perm;
+        synchronized( cachedPerms )
+        {
+            perm = (PagePermission)cachedPerms.get( key );
+            if( perm == null )
+            {
+                perm = new PagePermission( page, actions );
+                cachedPerms.put( key, perm );
+            }
+        }
+        return perm;
     }
     
     /**
      *  Get a permission object for a WikiPage and a set of actions.
      *  
-     *  @param page The name of the page.
+     *  @param page The name of the page, including the wiki prefix (e.g., MyWiki:Main)
      *  @param actions A list of actions.
      *  @return A PagePermission object, presenting this page+actions combination.
      */
     public static final PagePermission getPagePermission( String page, String actions )
     {
-        return getPagePermission( "", page, actions );
+        Map<Integer,Permission> cachedPerms = getPermissionCache( GroupPermission.class );
+        Integer key = new Integer( page.hashCode() ^ actions.hashCode() );
+        PagePermission perm;
+        synchronized( cachedPerms )
+        {
+            perm = (PagePermission)cachedPerms.get( key );
+            if( perm == null )
+            {
+                perm = new PagePermission( page, actions );
+                cachedPerms.put( key, perm );
+            }
+        }
+        return perm;
     }
 
     /**
@@ -71,41 +123,36 @@
      *  @param actions A list of actions.
      *  @return A PagePermission object.
      */
-    private static final PagePermission getPagePermission( String wiki, String page, String actions )
+    public static final WikiPermission getWikiPermission( String wiki, String actions )
     {
-        PagePermission perm;
-        //
-        //  Since this is pretty speed-critical, we try to avoid the StringBuffer creation
-        //  overhead by XORring the hashcodes.  However, if page name length > 32 characters,
-        //  this might result in two same hashCodes.
-        //  FIXME: Make this work for page-name lengths > 32 characters (use the alt implementation
-        //         if page.length() > 32?)
-        // Alternative implementation below, but it does create an extra StringBuffer.
-        //String         key = wiki+":"+page+":"+actions;
-        
-        Integer key = new Integer( wiki.hashCode() ^ page.hashCode() ^ actions.hashCode() );
-   
-        //
-        //  It's fine if two threads update the cache, since the objects mean the same
-        //  thing anyway.  And this avoids nasty blocking effects.
-        //
-        synchronized( c_cache )
+        Map<Integer,Permission> cachedPerms = getPermissionCache( GroupPermission.class );
+        Integer key = new Integer( wiki.hashCode() ^ actions.hashCode() );
+        WikiPermission perm;
+        synchronized( cachedPerms )
         {
-            perm = (PagePermission)c_cache.get( key );
+            perm = (WikiPermission)cachedPerms.get( key );
+            if( perm == null )
+            {
+                perm = new WikiPermission( wiki, actions );
+                cachedPerms.put( key, perm );
+            }
         }
-        
-        if( perm == null )
+        return perm;
+    }
+    
+    private static Map<Integer,Permission>getPermissionCache( Class<? extends Permission> permClass )
+    {
+        // Get the HashMap for our permission type (creating it if needed)
+        Map<Integer,Permission> cachedPerms = c_cache.get(permClass);
+        if ( cachedPerms == null )
         {
-            if( wiki.length() > 0 ) page = wiki+":"+page;
-            perm = new PagePermission( page, actions );
-            
-            synchronized( c_cache )
+            synchronized ( c_cache )
             {
-                c_cache.put( key, perm );
+                cachedPerms = new WeakHashMap<Integer,Permission>();
+                c_cache.put(permClass,cachedPerms);
             }
         }
-        
-        return perm;
+        return cachedPerms;
     }
 
 }

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/dav/AttachmentDavProvider.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/dav/AttachmentDavProvider.java?rev=630508&r1=630507&r2=630508&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/dav/AttachmentDavProvider.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/dav/AttachmentDavProvider.java Sat Feb 23 11:08:45 2008
@@ -26,9 +26,9 @@
 
 import org.apache.log4j.Logger;
 
-import com.ecyrd.jspwiki.WikiContext;
 import com.ecyrd.jspwiki.WikiEngine;
 import com.ecyrd.jspwiki.WikiPage;
+import com.ecyrd.jspwiki.action.AttachActionBean;
 import com.ecyrd.jspwiki.attachment.Attachment;
 import com.ecyrd.jspwiki.dav.items.AttachmentItem;
 import com.ecyrd.jspwiki.dav.items.DavItem;
@@ -172,7 +172,7 @@
 
         if( p.startsWith("/") ) p = p.substring( 1 );
 
-        return m_engine.getURL( WikiContext.ATTACH, p, null, true );
+        return DavUtil.combineURL( DavUtil.combineURL( m_engine.getBaseURL() , "attach/"), path.getPath() );
     }
 
 }

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/dav/HTMLPagesDavProvider.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/dav/HTMLPagesDavProvider.java?rev=630508&r1=630507&r2=630508&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/dav/HTMLPagesDavProvider.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/dav/HTMLPagesDavProvider.java Sat Feb 23 11:08:45 2008
@@ -23,9 +23,9 @@
 import java.util.Collection;
 import java.util.Iterator;
 
-import com.ecyrd.jspwiki.WikiContext;
 import com.ecyrd.jspwiki.WikiEngine;
 import com.ecyrd.jspwiki.WikiPage;
+import com.ecyrd.jspwiki.action.NoneActionBean;
 import com.ecyrd.jspwiki.dav.items.DavItem;
 import com.ecyrd.jspwiki.dav.items.DirectoryItem;
 import com.ecyrd.jspwiki.dav.items.HTMLPageDavItem;
@@ -120,8 +120,7 @@
     
     public String getURL( DavPath path )
     {
-        return m_engine.getURL( WikiContext.NONE, DavUtil.combineURL("dav/html",path.getPath()),
-                                null, true );
+        return DavUtil.combineURL( DavUtil.combineURL( m_engine.getBaseURL() , "dav/html"), path.getPath() );
     }
 
 }

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/dav/RawPagesDavProvider.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/dav/RawPagesDavProvider.java?rev=630508&r1=630507&r2=630508&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/dav/RawPagesDavProvider.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/dav/RawPagesDavProvider.java Sat Feb 23 11:08:45 2008
@@ -26,7 +26,6 @@
 
 import org.apache.log4j.Logger;
 
-import com.ecyrd.jspwiki.WikiContext;
 import com.ecyrd.jspwiki.WikiEngine;
 import com.ecyrd.jspwiki.WikiPage;
 import com.ecyrd.jspwiki.dav.items.DavItem;
@@ -164,8 +163,7 @@
     
     public String getURL( DavPath path )
     {
-        return m_engine.getURL( WikiContext.NONE, DavUtil.combineURL("dav/raw/",path.getPath()),
-                                null, true );
+        return DavUtil.combineURL( DavUtil.combineURL( m_engine.getBaseURL() , "dav/raw"), path.getPath() );
     }
     
     public DavItem getItem( DavPath dp )

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/dav/WikiRootProvider.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/dav/WikiRootProvider.java?rev=630508&r1=630507&r2=630508&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/dav/WikiRootProvider.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/dav/WikiRootProvider.java Sat Feb 23 11:08:45 2008
@@ -22,7 +22,6 @@
 import java.util.ArrayList;
 import java.util.Collection;
 
-import com.ecyrd.jspwiki.WikiContext;
 import com.ecyrd.jspwiki.WikiEngine;
 import com.ecyrd.jspwiki.dav.items.DavItem;
 import com.ecyrd.jspwiki.dav.items.TopLevelDavItem;
@@ -61,7 +60,7 @@
 
     public String getURL( DavPath path )
     {
-        return m_engine.getURL( WikiContext.NONE, "dav/"+path.getPath(), null, false );
+        return DavUtil.combineURL( DavUtil.combineURL( m_engine.getBaseURL() , "dav/"), path.getPath() );
     }
 
 }

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/dav/items/HTMLPageDavItem.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/dav/items/HTMLPageDavItem.java?rev=630508&r1=630507&r2=630508&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/dav/items/HTMLPageDavItem.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/dav/items/HTMLPageDavItem.java Sat Feb 23 11:08:45 2008
@@ -76,8 +76,7 @@
     {
         WikiEngine engine = ((WikiDavProvider)m_provider).getEngine();
 
-        WikiContext context = new WikiContext( engine, m_page );
-        context.setRequestContext( WikiContext.VIEW );
+        WikiContext context = engine.getWikiActionBeanFactory().newViewActionBean( m_page );
 
         context.setVariable( MarkupParser.PROP_RUNPLUGINS, "false" );
         context.setVariable( WikiEngine.PROP_RUNFILTERS, "false" );

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/diff/TraditionalDiffProvider.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/diff/TraditionalDiffProvider.java?rev=630508&r1=630507&r2=630508&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/diff/TraditionalDiffProvider.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/diff/TraditionalDiffProvider.java Sat Feb 23 11:08:45 2008
@@ -169,7 +169,7 @@
             double[] choiceLimits = { 1, 2 };
             
             MessageFormat fmt = new MessageFormat("");
-            fmt.setLocale( WikiContext.getLocale(m_context) );
+            fmt.setLocale( m_context.getContext().getLocale() );
             ChoiceFormat cfmt = new ChoiceFormat( choiceLimits, choiceString );
             fmt.applyPattern( type );
             Format[] formats = { NumberFormat.getInstance(), cfmt, NumberFormat.getInstance() };

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/filters/PingWeblogsComFilter.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/filters/PingWeblogsComFilter.java?rev=630508&r1=630507&r2=630508&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/filters/PingWeblogsComFilter.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/filters/PingWeblogsComFilter.java Sat Feb 23 11:08:45 2008
@@ -21,6 +21,8 @@
 
 import com.ecyrd.jspwiki.WikiContext;
 import com.ecyrd.jspwiki.WikiEngine;
+import com.ecyrd.jspwiki.action.ViewActionBean;
+
 import org.apache.xmlrpc.*;
 import java.net.URL;
 import java.net.MalformedURLException;
@@ -70,12 +72,12 @@
         try
         {
             XmlRpcClient xmlrpc = new XmlRpcClient(m_pingURL);
-            Vector params = new Vector();
+            Vector<String> params = new Vector<String>();
             params.addElement( "The Butt Ugly Weblog" ); // FIXME: Must be settable
-            params.addElement( engine.getURL( WikiContext.VIEW, blogName, null, true ) );
+            params.addElement( context.getContext().getURL( ViewActionBean.class, blogName, null, true ) );
 
             if( log.isDebugEnabled() )
-                log.debug("Pinging weblogs.com with URL: "+engine.getURL( WikiContext.VIEW, blogName, null, true ));
+                log.debug("Pinging weblogs.com with URL: "+context.getContext().getURL( ViewActionBean.class, blogName, null, true ));
 
             xmlrpc.executeAsync("weblogUpdates.ping", params, 
                                 new AsyncCallback() 

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/filters/SpamFilter.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/filters/SpamFilter.java?rev=630508&r1=630507&r2=630508&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/filters/SpamFilter.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/filters/SpamFilter.java Sat Feb 23 11:08:45 2008
@@ -35,10 +35,14 @@
 import org.apache.oro.text.regex.*;
 
 import com.ecyrd.jspwiki.*;
+import com.ecyrd.jspwiki.action.CommentActionBean;
+import com.ecyrd.jspwiki.action.NoneActionBean;
+import com.ecyrd.jspwiki.action.ViewActionBean;
 import com.ecyrd.jspwiki.attachment.Attachment;
 import com.ecyrd.jspwiki.auth.user.UserProfile;
 import com.ecyrd.jspwiki.providers.ProviderException;
 import com.ecyrd.jspwiki.ui.EditorManager;
+import com.ecyrd.jspwiki.ui.WikiInterceptor;
 
 /**
  *  This is Herb, the JSPWiki spamfilter that can also do choke modifications.
@@ -548,7 +552,7 @@
                 String userAgent     = req.getHeader("User-Agent");
                 String referrer      = req.getHeader( "Referer");
                 String permalink     = context.getViewURL( context.getPage().getName() );
-                String commentType   = context.getRequestContext().equals(WikiContext.COMMENT) ? "comment" : "edit";
+                String commentType   = context instanceof CommentActionBean ? "comment" : "edit";
                 String commentAuthor = context.getCurrentUser().getName();
                 String commentAuthorEmail = null;
                 String commentAuthorURL   = null;
@@ -938,10 +942,14 @@
      */
     private String getRedirectPage( WikiContext ctx )
     {
+        Map<String,String> urlParams = new HashMap<String,String>();
         if( m_useCaptcha )
-            return ctx.getURL( WikiContext.NONE, "Captcha.jsp", "page="+ctx.getEngine().encodeName(ctx.getPage().getName()) );
+        {
+            urlParams.put( "page", ctx.getEngine().encodeName( ctx.getPage().getName() ) );
+            return ctx.getContext().getURL( NoneActionBean.class, "Captcha.jsp", urlParams );
+        }
 
-        return ctx.getURL( WikiContext.VIEW, m_errorPage );
+        return ctx.getContext().getURL( ViewActionBean.class, m_errorPage);
     }
 
     /**
@@ -1065,7 +1073,7 @@
 
                 log( context, REJECT, "MissingHash", change );
 
-                String redirect = context.getURL(WikiContext.VIEW,"SessionExpired");
+                String redirect = context.getContext().getURL( ViewActionBean.class, "SessionExpired");
                 ((HttpServletResponse)pageContext.getResponse()).sendRedirect( redirect );
 
                 return false;
@@ -1077,8 +1085,7 @@
 
     public static final String insertInputFields( PageContext pageContext )
     {
-        WikiContext ctx = WikiContext.findContext(pageContext);
-        WikiEngine engine = ctx.getEngine();
+        WikiEngine engine = (WikiEngine)pageContext.getAttribute( WikiInterceptor.ATTR_WIKIENGINE, PageContext.REQUEST_SCOPE );
 
         StringBuffer sb = new StringBuffer();
         if (engine.getContentEncoding().equals("UTF-8"))

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/forms/FormOpen.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/forms/FormOpen.java?rev=630508&r1=630507&r2=630508&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/forms/FormOpen.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/forms/FormOpen.java Sat Feb 23 11:08:45 2008
@@ -24,7 +24,8 @@
 import java.util.Map;
 import java.util.ResourceBundle;
 
-import com.ecyrd.jspwiki.WikiContext;
+import com.ecyrd.jspwiki.*;
+import com.ecyrd.jspwiki.action.ViewActionBean;
 import com.ecyrd.jspwiki.plugin.PluginException;
 import com.ecyrd.jspwiki.plugin.WikiPlugin;
 
@@ -89,7 +90,7 @@
         String sourcePage = ctx.getPage().getName();
         String submitServlet = (String)params.get( PARAM_SUBMITHANDLER );
         if( submitServlet == null )
-            submitServlet = ctx.getURL( WikiContext.VIEW, sourcePage );
+            submitServlet = ctx.getContext().getURL( ViewActionBean.class, sourcePage );
 
         String method = (String)params.get( PARAM_METHOD );
         if( method == null ) method="post";

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/forms/FormOutput.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/forms/FormOutput.java?rev=630508&r1=630507&r2=630508&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/forms/FormOutput.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/forms/FormOutput.java Sat Feb 23 11:08:45 2008
@@ -24,7 +24,8 @@
 import java.util.Map;
 import java.util.ResourceBundle;
 
-import com.ecyrd.jspwiki.WikiContext;
+import com.ecyrd.jspwiki.*;
+import com.ecyrd.jspwiki.action.ViewActionBean;
 import com.ecyrd.jspwiki.plugin.PluginException;
 import com.ecyrd.jspwiki.plugin.PluginManager;
 import com.ecyrd.jspwiki.plugin.WikiPlugin;
@@ -91,7 +92,7 @@
         }
 
         String sourcePage = ctx.getPage().getName();
-        String submitServlet = ctx.getURL( WikiContext.VIEW, sourcePage );
+        String submitServlet = ctx.getContext().getURL( ViewActionBean.class, sourcePage );
 
         // If there is previous FormInfo available - say, from a
         // FormSet plugin - use it.