jspwiki-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ajaqu...@apache.org
Subject svn commit: r687533 - in /incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH: ./ doc/ etc/ lib/ src/com/ecyrd/jspwiki/action/ src/com/ecyrd/jspwiki/preferences/ src/webdocs/ src/webdocs/templates/default/ src/wikipages/en/ tests/lib/
Date Thu, 21 Aug 2008 01:24:08 GMT
Author: ajaquith
Date: Wed Aug 20 18:24:07 2008
New Revision: 687533

URL: http://svn.apache.org/viewvc?rev=687533&view=rev
Log:
Refactored JSPs Login.jsp and its template components to work better with Stripes.

Added:
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/lib/stripes-1.5.jar   (with props)
Removed:
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/lib/stripes-1.5-rc1.jar
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/lib/stripes-1.5-RC1.jar
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/lib/stripes-1.5-SNAPSHOT-947.jar
Modified:
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/.classpath
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/doc/README - Stripes Migration
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/etc/web.xml
    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/LoginActionBean.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/UserProfileActionBean.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/preferences/Preferences.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs/Login.jsp
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs/LoginForm.jsp
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs/templates/default/LoginContent.jsp
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs/templates/default/ProfileTab.jsp
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/wikipages/en/Community.txt
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/wikipages/en/InstallationTips.txt
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/wikipages/en/LeftMenu.txt
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/wikipages/en/LoginHelp.txt
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/wikipages/en/Main.txt
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/wikipages/en/PageIndex.txt

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/.classpath
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/.classpath?rev=687533&r1=687532&r2=687533&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/.classpath (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/.classpath Wed Aug 20 18:24:07 2008
@@ -38,7 +38,7 @@
 	<classpathentry kind="lib" path="tests/lib/jetty-jmx-5.1.14.jar"/>
 	<classpathentry kind="lib" path="tests/lib/jetty-plus-5.1.14.jar"/>
 	<classpathentry kind="lib" path="tests/lib/jetty-servlet-5.1.14.jar" sourcepath="/Users/arj/workspace/lib/jetty-5.1.14/src"/>
-	<classpathentry kind="lib" path="tests/lib/stripes-1.5-SNAPSHOT-947.jar" sourcepath="/stripes-1.5-SNAPSHOT-947/stripes/src"/>
+	<classpathentry kind="lib" path="lib/stripes-1.5.jar" sourcepath="/stripes-1.5/stripes/src"/>
 	<classpathentry kind="lib" path="tests/lib/selenium-server-1.0-beta1.jar"/>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.launching.macosx.MacOSXType/JVM 1.5.0"/>
 	<classpathentry kind="output" path="classes"/>

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=687533&r1=687532&r2=687533&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 Wed Aug 20 18:24:07 2008
@@ -51,6 +51,19 @@
 
 Note: JSPs that create these (pre-3.0) WikiContexts will need to be changed:
 ADMIN, CREATE_GROUP, DELETE_GROUP, EDIT_GROUP, ERROR, FIND, INSTALL, LOGIN, LOGOUT, MESSAGE, NONE, OTHER, PREFS, RSS, VIEW_GROUP, WORKFLOW.
+Admin.jsp
+NewGroup.jsp
+DeleteGroup.jsp
+EditGroup.jsp
+Search.jsp
+templates/default/AJAXSearch.jsp
+Install.jsp
+LoginForm.jsp
+LostPassword.jsp
+admin/SecurityConfig.jsp
+UserPreferences.jsp
+Group.jsp
+Workflow.jsp
 
 Scriptlet code
 --------------
@@ -272,7 +285,7 @@
 setPage()
 findContext() -- no change
 hasAdminPermissions()
-getLocale(m_context) -- forwards to WikiActionBeanContext.getLocale();
+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)
@@ -359,6 +372,10 @@
 -----------
 WikiTagBase changes slightly to support Stripes. Instead of extending import javax.servlet.jsp.tagext.TagSupport, it now extends StripesTagSupport. However, StripesTagSupport does not supply the methods setId/GetId. So, we've had to implement these. Also, the method TagSupport.findAncestorWithClass which is used by TabTag needs to be replaced by StripesTagSupport.getParentTag (without need for classcast).
 
+Preferences
+-----------
+Preferences.getLocale(WikiContext) was re-wired to delegate to WikiActionContext.getLocale(), as determined by Stripes. WikiContext.getBundle(String) was similarly re-wired.
+
 =========================================================================================
 
 TESTING NOTES
@@ -366,8 +383,54 @@
 
 JSP Migration
 -------------
-Form tags:
-- JavaScript onSubmit() code should be scrubbed?
+<form> becomes <stripes:form>, </form> becomes </stripes:form>
+Remove <form> onsubmit="return Wiki.submitOnce(this);" because Stripes takes care of double-submits. accept-charset becomes "acceptcharset" and should use EL.
+
+    acceptcharset="${wikiEngine.contentEncoding}"
+    
+If a form action URL has an & appended to it, these should be added back as <stripes:param> tags. E.g., 
+    <form action="Login.jsp?tab=profile>
+means <stripes:param name="tab" value="profile">
+
+<input type="text"> becomes <stripes:text>; type attribute goes away. Value attribute contents should be moved into the body of the tag. So:
+
+    <input type="text" size="24" value="<wiki:Variable var='uid' default='' />" name="j_username" id="j_username" />
+         
+becomes this:
+
+    <stripes:text size="24" name="j_username" id="j_username"><wiki:Variable var="uid" default=""/></stripes:text>
+                                  
+<input type="password"> becomes <stripes:password>; type attribute goes away
+<input type="checkbox"> becomes <stripes:checkbox>; type attribute goes away
+
+<input type="submit"> becomes <stripes:submit>; type attribute goes away. "Name" should be the name of the event handler for the ActionBean that is executed. The value attribute should be moved into the body of the tag. So:
+
+    <input type="submit" name="login" value="<fmt:message key='login.submit.login'/>" />
+        
+becomes this:
+
+    <stripes:submit name="login"><fmt:message key="login.submit.login"/></stripes:submit>
+
+
+Hidden values are PROBABLY candidates to become bean properties that are automatically bound. E.g., in LoginForm.jsp,
+<input type="hidden" name="redirect" value="<wiki:Variable var='redirect' default='' />" /> disappears because setRedirect() is already part of LoginActionBean.
+
+Replace:
+        <wiki:Messages div="error" topic="login"
+                    prefix='<%=LocaleSupport.getLocalizedMessage(pageContext,"login.errorprefix")%>' />
+
+with this:
+
+      <div class="error">
+        <stripes:errors beanclass="com.ecyrd.jspwiki.action.LoginActionBean"/>
+      </div>
+
+LocalePicker will need to default to the user's Preferences setting... we will need to create a separate class for this.
+
+Validation guidelines:
+1. Default the @Validate messages to the same resource bundle used by the templates. This would be default*.properties. Practically speaking, this means that the current contents of StripesResources.properties (which have the default messages for @Validate validations) would be appended to default*.properties. Stripes messages and keys are VERY stable.
+2. For @ValidateMethod custom validation methods, always add SimpleErrors to the ValidationProperties object. The message string passed to the SimpleError constructor should be the final text that is obtained by looking it up in CoreResources.
+3. For event handler methods (i.e., they have a @HandlesEvent annotation) that generate errors, do the same as #2: look up the final string in CoreResources and pass it to the SimpleError constructor.
 
 
 Eclipse Tools Notes

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/etc/web.xml
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/etc/web.xml?rev=687533&r1=687532&r2=687533&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/etc/web.xml (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/etc/web.xml Wed Aug 20 18:24:07 2008
@@ -76,6 +76,11 @@
          <param-name>LocalizationBundleFactory.ErrorMessageBundle</param-name>
          <param-value>templates.default</param-value>
       </init-param>
+      <!-- Locales supported by this wiki -->
+      <init-param>
+         <param-name>LocalePicker.Locales</param-name>
+         <param-value>en:UTF8,de:UTF8,es:UTF8,fi:UTF8,it:UTF8,ln:UTF8,zh_CN:UTF8,</param-value>
+      </init-param>
       <!-- Library for parsing multi-part file uploads -->
       <init-param>
         <param-name>MultipartWrapper.Class</param-name>

Added: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/lib/stripes-1.5.jar
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/lib/stripes-1.5.jar?rev=687533&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/lib/stripes-1.5.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

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=687533&r1=687532&r2=687533&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 Wed Aug 20 18:24:07 2008
@@ -10,7 +10,6 @@
 import com.ecyrd.jspwiki.WikiEngine;
 import com.ecyrd.jspwiki.WikiSession;
 import com.ecyrd.jspwiki.auth.WikiPrincipal;
-import com.ecyrd.jspwiki.preferences.Preferences;
 
 /**
  * <p>
@@ -76,8 +75,7 @@
 
     /**
      * Returns the WikiEngine, which may be <code>null</code> if this instance
-     * was created without invoking the WikiActionBeanContext methods
-     * {@link WikiActionBeanContext#setRequest(HttpServletRequest)} or
+     * was created without invoking the WikiActionBeanContext method
      * {@link WikiActionBeanContext#setServletContext(javax.servlet.ServletContext)}.
      */
     public WikiEngine getEngine()
@@ -224,8 +222,8 @@
     }
 
     /**
-     * Locates the i18n ResourceBundle given. This method interprets the request
-     * locale, and uses that to figure out which language the user wants.
+     * 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.
@@ -236,12 +234,12 @@
     // something...
     public ResourceBundle getBundle( String bundle ) throws MissingResourceException
     {
-        Locale loc = Preferences.getLocale( this );
-
-        if( m_actionBeanContext != null && m_actionBeanContext.getRequest() != null )
+        if( m_actionBeanContext == null || m_actionBeanContext.getRequest() == null )
         {
-            loc = m_actionBeanContext.getRequest().getLocale();
+            throw new IllegalStateException( "WikiActionBean did not have a valid ActionBeanContext or associated request." );
         }
+
+        Locale loc = m_actionBeanContext.getRequest().getLocale();
         ResourceBundle b = getEngine().getInternationalizationManager().getBundle( bundle, loc );
 
         return b;

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=687533&r1=687532&r2=687533&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 Wed Aug 20 18:24:07 2008
@@ -22,7 +22,7 @@
 import com.ecyrd.jspwiki.auth.login.CookieAuthenticationLoginModule;
 import com.ecyrd.jspwiki.auth.permissions.WikiPermission;
 
-@UrlBinding( "/Login.jsp" )
+@UrlBinding( "/Login.action" )
 public class LoginActionBean extends AbstractActionBean
 {
     private static final Logger log = Logger.getLogger( LoginActionBean.class );
@@ -73,7 +73,7 @@
         return m_remember;
     }
 
-    public String getJ_userName()
+    public String getJ_username()
     {
         return m_username;
     }
@@ -88,23 +88,23 @@
     public Resolution login()
     {
         WikiSession wikiSession = this.getWikiSession();
+        ValidationErrors errors = getContext().getValidationErrors();
+        ResourceBundle rb = 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() )
         {
-            ResourceBundle rb = getBundle( "CoreResources" );
-            String message = rb.getString( "login.error.noaccess" );
-            getContext().getValidationErrors().addGlobalError( new SimpleError( message ) );
-            return new RedirectResolution( MessageActionBean.class ).flash( this );
+            errors.addGlobalError( new SimpleError( rb.getString( "login.error.noaccess" ) ) );
+            getContext().flash( this );
+            return new RedirectResolution( MessageActionBean.class );
         }
 
         log.debug( "Attempting to authenticate user " + m_username );
 
         // Log the user in!
         Resolution r = null;
-        ValidationErrors errors = getContext().getValidationErrors();
         try
         {
             if( getEngine().getAuthenticationManager().login( wikiSession, m_username, m_password ) )
@@ -116,20 +116,20 @@
             else
             {
                 log.info( "Failed to authenticate user " + m_username );
-                errors.addGlobalError( new SimpleError( "login.error.password" ) );
-
+                errors.addGlobalError( new SimpleError( rb.getString( "login.error.password" ) ) );
             }
         }
         catch( WikiSecurityException e )
         {
-            errors.addGlobalError( new SimpleError( "login.error", e.getMessage() ) );
+            errors.addGlobalError( new SimpleError( rb.getString( "login.error" ), e.getMessage() ) );
         }
 
         // Any errors?
         if( !errors.isEmpty() )
         {
-            UrlBuilder builder = new UrlBuilder( getContext().getLocale(), LoginActionBean.class, false );
+            UrlBuilder builder = new UrlBuilder( getContext().getLocale(), "/Login.jsp", false );
             builder.addParameter( "tab", "logincontent" );
+            getContext().flash( this );
             r = new RedirectResolution( builder.toString() );
         }
 
@@ -214,9 +214,9 @@
             if( seen != null )
             {
                 ResourceBundle rb = getBundle( "CoreResources" );
-                String message = rb.getString( "login.error.noaccess" );
-                getContext().getValidationErrors().addGlobalError( new SimpleError( message ) );
-                return new RedirectResolution( MessageActionBean.class ).flash( this );
+                getContext().getValidationErrors().addGlobalError( new SimpleError( rb.getString( "login.error.noaccess" ) ) );
+                getContext().flash( this );
+                return new RedirectResolution( MessageActionBean.class );
             }
             session.setAttribute( "_redirect", "I love Outi" ); // Any marker
             // will do

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/RSSActionBean.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/RSSActionBean.java?rev=687533&r1=687532&r2=687533&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/RSSActionBean.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/RSSActionBean.java Wed Aug 20 18:24:07 2008
@@ -6,6 +6,7 @@
 
 import com.ecyrd.jspwiki.WikiContext;
 import com.ecyrd.jspwiki.WikiEngine;
+import com.ecyrd.jspwiki.WikiException;
 import com.ecyrd.jspwiki.WikiPage;
 import com.ecyrd.jspwiki.auth.permissions.PagePermission;
 
@@ -18,17 +19,15 @@
      * @param engine The WikiEngine that is handling the request.
      * @param page The WikiPage. If you want to create an RSSActionBean for an
      *            older version of a page, you must use this constructor.
+     * @throws WikiException 
      */
-    public static RSSActionBean getRSSActionBean( WikiEngine engine, WikiPage page )
+    public static RSSActionBean getRSSActionBean( WikiEngine engine, WikiPage page ) throws WikiException
     {
         if( engine == null )
         {
             throw new IllegalArgumentException( "Parameter engine must not be null." );
         }
-        WikiActionBeanContext context = new WikiActionBeanContext();
-        context.setWikiEngine( engine );
-        RSSActionBean rssBean = new RSSActionBean();
-        rssBean.setContext( context );
+        RSSActionBean rssBean = (RSSActionBean)engine.getWikiActionBeanFactory().newActionBean( null, null, RSSActionBean.class );
         rssBean.setPage( page );
         return rssBean;
     }

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/UserProfileActionBean.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/UserProfileActionBean.java?rev=687533&r1=687532&r2=687533&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/UserProfileActionBean.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/UserProfileActionBean.java Wed Aug 20 18:24:07 2008
@@ -230,7 +230,7 @@
         {
             if( m_profile.getPassword() == null )
             {
-                errors.add( "profile.password", new ScopedLocalizableError( "validation.required", "valueNotPresent" ) );
+                errors.add( "profile.password", new LocalizableError( "valueNotPresent" ) );
             }
         }
 
@@ -240,7 +240,7 @@
         {
             if( !m_profile.getPassword().equals( m_passwordAgain ) )
             {
-                errors.add( "profile.password", new ScopedLocalizableError( "validation.required", "noPasswordMatch" ) );
+                errors.add( "profile.password", new LocalizableError( "noPasswordMatch" ) );
             }
         }
     }

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/WikiActionBean.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/WikiActionBean.java?rev=687533&r1=687532&r2=687533&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/WikiActionBean.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/WikiActionBean.java Wed Aug 20 18:24:07 2008
@@ -63,8 +63,7 @@
     
     /**
      * Returns the WikiEngine, which may be <code>null</code> if this instance
-     * was created without invoking the WikiActionBeanContext methods
-     * {@link WikiActionBeanContext#setRequest(HttpServletRequest)} or
+     * was created without invoking the WikiActionBeanContext method
      * {@link WikiActionBeanContext#setServletContext(javax.servlet.ServletContext)}.
      */
     public WikiEngine getEngine();

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/WikiActionBeanContext.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/WikiActionBeanContext.java?rev=687533&r1=687532&r2=687533&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/WikiActionBeanContext.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/WikiActionBeanContext.java Wed Aug 20 18:24:07 2008
@@ -4,17 +4,27 @@
 import javax.servlet.http.HttpServletRequest;
 
 import net.sourceforge.stripes.action.ActionBeanContext;
+import net.sourceforge.stripes.controller.FlashScope;
 
 import com.ecyrd.jspwiki.WikiEngine;
+import com.ecyrd.jspwiki.WikiPage;
 import com.ecyrd.jspwiki.WikiSession;
+import com.ecyrd.jspwiki.tags.WikiTagBase;
 
 /**
+ * <p>
  * {@link net.sourceforge.stripes.action.ActionBeanContext} subclass that
  * contains a convenient reference to the current JSPWiki WikiEngine and the
- * user's HttpServletRequest. The WikiEngine reference is lazily initialized
- * when either {@link #setServletContext(ServletContext)} or
- * {@link #setRequest(HttpServletRequest)} is invoked. The HttpServletRequest
- * reference is set via {@link #setRequest(HttpServletRequest)}.
+ * user's HttpServletRequest and WikiSession.
+ * </p>
+ * <p>
+ * When the WikiActionBeanContext is created, callers <em>must</em> set the
+ * WikiEngine reference by calling either {@link #setWikiEngine(WikiEngine)}
+ * (which sets it directly), or {@link #setServletContext(ServletContext)}
+ * (which sets it lazily). when {@link #setServletContext(ServletContext)}. The
+ * HttpServletRequest reference is set via
+ * {@link #setRequest(HttpServletRequest)}.
+ * </p>
  * 
  * @author Andrew Jaquith
  */
@@ -22,24 +32,14 @@
 {
     private volatile WikiEngine m_engine = null;
 
-    public WikiActionBeanContext()
-    {
-        super();
-    }
-
-    public WikiSession getWikiSession()
-    {
-        return WikiSession.getWikiSession( m_engine, getRequest() );
-    }
+    private volatile WikiSession m_wikiSession = null;
 
     /**
-     * Sets the WikiEngine associated with this WikiActionBeanContext.
-     * 
-     * @param engine the wiki engine
+     * Constructs a new WikiActionBeanContext.
      */
-    public void setWikiEngine( WikiEngine engine )
+    public WikiActionBeanContext()
     {
-        m_engine = engine;
+        super();
     }
 
     /**
@@ -53,28 +53,11 @@
     }
 
     /**
-     * Calls the superclass
-     * {@link ActionBeanContext#setRequest(HttpServletRequest)} and lazily sets
-     * the internal WikiEngine reference, if still <code>null</code>.
-     * 
-     * @param request the HTTP request
+     * Returns the WikiSession associated with this WikiActionBeanContext.
      */
-    @Override
-    public void setRequest( HttpServletRequest request )
+    public WikiSession getWikiSession()
     {
-        super.setRequest( request );
-        if( request != null )
-        {
-            // Lazily set the WikiEngine reference
-            if( m_engine == null )
-            {
-                ServletContext servletContext = request.getSession().getServletContext();
-                m_engine = WikiEngine.getInstance( servletContext, null );
-            }
-        }
-
-        // Retrieve the WikiSession, which executes the login stack (if needed)
-        WikiSession.getWikiSession( m_engine, request );
+        return m_wikiSession;
     }
 
     /**
@@ -95,4 +78,53 @@
         }
     }
 
+    /**
+     * Sets the WikiEngine associated with this WikiActionBeanContext.
+     * 
+     * @param engine the wiki engine
+     */
+    public void setWikiEngine( WikiEngine engine )
+    {
+        m_engine = engine;
+    }
+
+    /**
+     * Sets the WikiSession associated with this WikiActionBeanContext.
+     * 
+     * @param session the wiki session
+     */
+    public void setWikiSession( WikiSession session )
+    {
+        m_wikiSession = session;
+    }
+
+    /**
+     * Adds a supplied ActionBean to "flash scope" so that it can be used by the next
+     * HttpRequest. When this method is called, the ActionBean is stashed in the
+     * request and the flash scope as attributes. For both, the bean is stored
+     * under names {@link WikiActionBeanFactory.ATTR_ACTIONBEAN}
+     * and {@link WikiTagBase.ATTR_CONTEXT}. This method assumes that the
+     * method {@link #setRequest(HttpServletRequest)} has been previously called.
+     * @param actionBean the action bean to add
+     * @throws IllegalStateException if the request object has not been previously set
+     * for this ActionBeanContext
+     */
+    public void flash( WikiActionBean actionBean )
+    {
+        if ( getRequest() == null )
+        {
+            throw new IllegalStateException( "Request not set! Cannot flash action bean." );
+        }
+        FlashScope flash = FlashScope.getCurrent( getRequest(), true);
+        flash.put( actionBean );
+        flash.put( WikiActionBeanFactory.ATTR_ACTIONBEAN, actionBean );
+        
+        // If not a WikiContext, synthesize a fake one
+        WikiPage page = m_engine.getPage( m_engine.getFrontPage() );
+        actionBean = m_engine.getWikiActionBeanFactory().newViewActionBean( getRequest(), getResponse(), page );
+        
+        // Stash the WikiContext
+        flash.put( WikiTagBase.ATTR_CONTEXT, actionBean );
+    }
+    
 }

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/WikiActionBeanFactory.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/WikiActionBeanFactory.java?rev=687533&r1=687532&r2=687533&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/WikiActionBeanFactory.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/WikiActionBeanFactory.java Wed Aug 20 18:24:07 2008
@@ -11,6 +11,7 @@
 import javax.servlet.http.HttpServletResponse;
 
 import net.sourceforge.stripes.action.RedirectResolution;
+import net.sourceforge.stripes.controller.StripesConstants;
 import net.sourceforge.stripes.mock.MockHttpServletRequest;
 import net.sourceforge.stripes.mock.MockHttpServletResponse;
 import net.sourceforge.stripes.mock.MockHttpSession;
@@ -502,13 +503,15 @@
             response = new MockHttpServletResponse();
         }
 
-        // Create the WikiActionBeanContext
+        // Create the WikiActionBeanContext and set all of its relevant properties
         WikiActionBeanContext actionBeanContext = new WikiActionBeanContext();
         bean.setContext( actionBeanContext );
         actionBeanContext.setRequest( request );
         actionBeanContext.setResponse( response );
         actionBeanContext.setWikiEngine( m_engine );
         actionBeanContext.setServletContext( m_engine.getServletContext() );
+        WikiSession wikiSession = SessionMonitor.getInstance( m_engine ).find( request.getSession() );
+        actionBeanContext.setWikiSession( wikiSession );
 
         // Set the event name for this action bean to the default handler
         actionBeanContext.setEventName( HandlerInfo.getDefaultHandlerInfo( beanClass ).getEventName() );
@@ -596,15 +599,31 @@
     /**
      * Returns the WikiActionBean associated with the current
      * {@link javax.servlet.http.HttpServletRequest}. The ActionBean will be
-     * retrieved from attribute {@link WikiInterceptor#ATTR_ACTIONBEAN}.
+     * retrieved from attribute {@link WikiInterceptor#ATTR_ACTIONBEAN}. If
+     * an ActionBean is not found under this name, the standard Stripes  attribute
+     * {@link net.sourceforge.stripes.controller.StripesConstants#REQ_ATTR_ACTION_BEAN}
+     * will be attempted.
      * 
      * @param pageContext the
-     * @return the WikiActionBean, or <code>null</code> if not found in the
-     *         current tag's PageContext
+     * @return the WikiActionBean
+     * @throws IllegalStateException if the WikiActionBean was not found in the
+     *         request scope
      */
     public static WikiActionBean findActionBean( ServletRequest request )
     {
-        return (WikiActionBean) request.getAttribute( ATTR_ACTIONBEAN );
+        WikiActionBean bean = (WikiActionBean) request.getAttribute( ATTR_ACTIONBEAN );
+        if ( bean == null )
+        {
+            log.debug( "WikiActionBean not found under request attribute '" + ATTR_ACTIONBEAN +
+                       "'; trying standard Stripes attribute '" + StripesConstants.REQ_ATTR_ACTION_BEAN + "'." );
+            bean = (WikiActionBean) request.getAttribute( StripesConstants.REQ_ATTR_ACTION_BEAN  );
+        }
+        
+        if ( bean == null )
+        {
+            throw new IllegalStateException( "WikiActionBean not found in request! Something failed to stash it..." );
+        }
+        return bean;
     }
 
     /**

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/WikiInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/WikiInterceptor.java?rev=687533&r1=687532&r2=687533&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/WikiInterceptor.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/action/WikiInterceptor.java Wed Aug 20 18:24:07 2008
@@ -19,6 +19,7 @@
 import com.ecyrd.jspwiki.WikiEngine;
 import com.ecyrd.jspwiki.WikiSession;
 import com.ecyrd.jspwiki.auth.AuthorizationManager;
+import com.ecyrd.jspwiki.auth.SessionMonitor;
 
 /**
  * <p>
@@ -123,12 +124,21 @@
             return r;
         }
 
+        // Retrieve the ActionBean, its ActionBeanContext, and HTTP request
         WikiActionBean actionBean = (WikiActionBean) context.getActionBean();
-        WikiActionBeanContext beanContext = actionBean.getContext();
-        HttpServletRequest httpRequest = beanContext.getRequest();
+        WikiActionBeanContext actionBeanContext = actionBean.getContext();
+        HttpServletRequest request = actionBeanContext.getRequest();
+
+        // Set the WikiSession, if not set yet
+        if ( actionBeanContext.getWikiSession() == null )
+        {
+            WikiEngine engine = actionBeanContext.getWikiEngine();
+            WikiSession wikiSession = SessionMonitor.getInstance( engine ).find( request.getSession() );
+            actionBeanContext.setWikiSession( wikiSession );
+        }
 
         // Stash the WikiActionBean and WikiPage in the request
-        WikiActionBeanFactory.saveActionBean( httpRequest, actionBean );
+        WikiActionBeanFactory.saveActionBean( request, actionBean );
 
         if( log.isDebugEnabled() )
         {

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/preferences/Preferences.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/preferences/Preferences.java?rev=687533&r1=687532&r2=687533&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/preferences/Preferences.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/preferences/Preferences.java Wed Aug 20 18:24:07 2008
@@ -37,6 +37,7 @@
 import com.ecyrd.jspwiki.TextUtil;
 import com.ecyrd.jspwiki.WikiContext;
 import com.ecyrd.jspwiki.action.WikiActionBean;
+import com.ecyrd.jspwiki.action.WikiActionBeanContext;
 import com.ecyrd.jspwiki.i18n.InternationalizationManager;
 import com.ecyrd.jspwiki.util.HttpUtil;
 
@@ -195,7 +196,7 @@
 
     
     /**
-     * Get Locale according to user-preference settings or the user browser locale
+     * Get Locale according to the Stripes ActionBeanContext.
      * 
      * @param context The context to examine.
      * @return a Locale object.
@@ -203,20 +204,13 @@
      */
     public static Locale getLocale(WikiActionBean context)
     {
-        Locale loc = null;
-        
-        String language = Preferences.getPreference( context, "Language" );
-
-        if( language != null)
-            loc = new Locale(language);
-
-        if( loc == null) 
-        {    
-            HttpServletRequest request = context.getHttpRequest();
-            loc = ( request != null ) ? request.getLocale() : Locale.getDefault();
+        WikiActionBeanContext beanContext = context.getContext();
+        if( beanContext == null || beanContext.getRequest() == null )
+        {
+            throw new IllegalStateException( "WikiActionBean did not have a valid ActionBeanContext or associated request." );
         }
-                
-        return loc;
+
+        return beanContext.getRequest().getLocale();
     }
 
     /**

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs/Login.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs/Login.jsp?rev=687533&r1=687532&r2=687533&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs/Login.jsp (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs/Login.jsp Wed Aug 20 18:24:07 2008
@@ -1,24 +1,2 @@
-<%@ page import="org.apache.log4j.*" %>
-<%@ page import="com.ecyrd.jspwiki.*" %>
-<%@ page import="java.security.Principal" %>
-<%@ page import="com.ecyrd.jspwiki.action.*" %>
-<%@ page import="com.ecyrd.jspwiki.auth.*" %>
-<%@ page import="com.ecyrd.jspwiki.auth.login.CookieAssertionLoginModule" %>
-<%@ page import="com.ecyrd.jspwiki.auth.login.CookieAuthenticationLoginModule" %>
-<%@ page import="com.ecyrd.jspwiki.auth.user.DuplicateUserException" %>
-<%@ page import="com.ecyrd.jspwiki.auth.user.UserProfile" %>
-<%@ page import="com.ecyrd.jspwiki.workflow.DecisionRequiredException" %>
-<%@ page import="com.ecyrd.jspwiki.tags.WikiTagBase" %>
 <%@ page errorPage="/Error.jsp" %>
-<%@ page import="java.util.*" %>
-<%@ taglib uri="/WEB-INF/jspwiki.tld" prefix="wiki" %>
-<%@ taglib uri="/WEB-INF/stripes.tld" prefix="stripes" %>
-<%!
-    Logger log = Logger.getLogger("JSPWiki");
-%>
-<stripes:useActionBean beanclass="com.ecyrd.jspwiki.action.LoginActionBean"/>
-<%
-    WikiEngine wiki = WikiEngine.getInstance( getServletConfig() );
-    response.setContentType("text/html; charset="+wiki.getContentEncoding() );
-
-%><jsp:include page="LoginForm.jsp" />
\ No newline at end of file
+<jsp:include page="LoginForm.jsp" />
\ No newline at end of file

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs/LoginForm.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs/LoginForm.jsp?rev=687533&r1=687532&r2=687533&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs/LoginForm.jsp (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs/LoginForm.jsp Wed Aug 20 18:24:07 2008
@@ -1,8 +1,10 @@
 <%@ page import="org.apache.log4j.*" %>
 <%@ page import="com.ecyrd.jspwiki.*" %>
-<%@ page import="com.ecyrd.jspwiki.tags.WikiTagBase" %>
+<%@ page import="com.ecyrd.jspwiki.action.*" %>
 <%@ page errorPage="/Error.jsp" %>
 <%@ taglib uri="/WEB-INF/jspwiki.tld" prefix="wiki" %>
+<%@ taglib uri="/WEB-INF/stripes.tld" prefix="stripes" %>
+<stripes:useActionBean beanclass="com.ecyrd.jspwiki.action.LoginActionBean"/>
 <%! 
     /**
      * This page contains the logic for finding and including
@@ -19,17 +21,8 @@
     WikiEngine wiki = WikiEngine.getInstance( getServletConfig() );
     // Retrieve the Login page context, then go and find the login form
 
-    WikiContext wikiContext = (WikiContext) pageContext.getAttribute( WikiTagBase.ATTR_CONTEXT, PageContext.REQUEST_SCOPE );
-    
-    // If no context, it means we're using container auth.  So, create one anyway
-    if( wikiContext == null )
-    {
-        wikiContext = wiki.createContext( request, WikiContext.LOGIN );
-        pageContext.setAttribute( WikiTagBase.ATTR_CONTEXT,
-                                  wikiContext,
-                                  PageContext.REQUEST_SCOPE );
-    }
-    
+    WikiActionBean wikiContext = WikiActionBeanFactory.findActionBean( request );
+    wikiContext.setVariable( "contentTemplate", "LoginContent.jsp" );
     response.setContentType("text/html; charset="+wiki.getContentEncoding() );
     String contentPage = wiki.getTemplateManager().findJSP( pageContext,
                                                             wikiContext.getTemplate(),

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs/templates/default/LoginContent.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs/templates/default/LoginContent.jsp?rev=687533&r1=687532&r2=687533&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs/templates/default/LoginContent.jsp (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs/templates/default/LoginContent.jsp Wed Aug 20 18:24:07 2008
@@ -1,16 +1,15 @@
 <%@ taglib uri="/WEB-INF/jspwiki.tld" prefix="wiki" %>
 <%@ page import="com.ecyrd.jspwiki.*" %>
-<%@ page import="com.ecyrd.jspwiki.*" %>
+<%@ page import="com.ecyrd.jspwiki.action.*" %>
 <%@ page import="com.ecyrd.jspwiki.auth.*" %>
 <%@ page errorPage="/Error.jsp" %>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<%@ taglib uri="/WEB-INF/stripes.tld" prefix="stripes" %>
 <%@ page import="javax.servlet.jsp.jstl.fmt.*" %>
-<fmt:setLocale value="${prefs.Language}" />
-<fmt:setBundle basename="templates.default"/>
 <%
     String postURL = "";
-    WikiContext ctx = WikiContext.findContext( pageContext );
+    WikiActionBean ctx = WikiContext.findContext( pageContext );
     AuthenticationManager mgr = ctx.getEngine().getAuthenticationManager();
 
     if( mgr.isContainerAuthenticated() )
@@ -19,9 +18,7 @@
     }
     else
     {
-        String redir = (String)ctx.getVariable("redirect");
-        if( redir == null ) redir = ctx.getEngine().getFrontPage();
-        postURL = ctx.getURL( WikiContext.LOGIN, redir );
+        postURL = "/Login.action";
     }
 
     boolean supportsCookieAuthentication = mgr.allowsCookieAuthentication();
@@ -33,11 +30,10 @@
 <wiki:Tab id="logincontent" title='<%=LocaleSupport.getLocalizedMessage(pageContext, "login.tab")%>'>
 <%--<wiki:Include page='LoginTab.jsp'/>--%>
 
-<form action="<%=postURL%>"
+<stripes:form action="<%=postURL%>"
           id="login"
        class="wikiform"
-    onsubmit="return Wiki.submitOnce(this);"
-      method="post" accept-charset="<wiki:ContentEncoding />" >
+      method="post" acceptcharset="${wikiEngine.contentEncoding}" >
 
 <div class="center">
 
@@ -48,32 +44,31 @@
   <table>
     <tr>
       <td colspan="2" class="formhelp">
-        <wiki:Messages div="error" topic="login"
-                    prefix='<%=LocaleSupport.getLocalizedMessage(pageContext,"login.errorprefix")%>' />
+      <div class="error">
+        <stripes:errors beanclass="com.ecyrd.jspwiki.action.LoginActionBean"/>
+      </div>
       </td>
     </tr>
     <tr>
       <td><label for="j_username"><fmt:message key="login.login"/></label></td>
-      <td><input type="text" size="24" value="<wiki:Variable var='uid' default='' />"
-                 name="j_username" id="j_username" /></td>
+      <td>
+        <stripes:text size="24" name="j_username" id="j_username"><wiki:Variable var="uid" default=""/></stripes:text>
+      </td>
     </tr>
     <tr>
       <td><label for="j_password"><fmt:message key="login.password"/></label></td>
-      <td><input type="password" size="24"
-                 name="j_password" id="j_password" /></td>
+      <td><stripes:password size="24" name="j_password" id="j_password" /></td>
     </tr>
     <% if( supportsCookieAuthentication ) { %>
     <tr>
       <td><label for="j_remember"><fmt:message key="login.remember"/></label></td>
-      <td><input type="checkbox"
-                 name="j_remember" id="j_remember" /></td>
+      <td><stripes:checkbox name="j_remember" id="j_remember" /></td>
     </tr>
     <% } %>
     <tr>
       <td>&nbsp;</td>
       <td>
-        <input type="hidden" name="redirect" value="<wiki:Variable var='redirect' default='' />" />
-        <input type="submit" name="submitlogin" value="<fmt:message key='login.submit.login'/>" />
+        <stripes:submit name="login"><fmt:message key="login.submit.login"/></stripes:submit>
       </td>
     </tr>
     </table>
@@ -96,7 +91,7 @@
     </div>
 
 </div>
-</form>
+</stripes:form>
 
 </wiki:Tab>
 
@@ -104,11 +99,10 @@
 <wiki:Tab id="lostpassword" title='<%=LocaleSupport.getLocalizedMessage(pageContext, "login.lostpw.tab")%>'>
 
 <div class="center">
-<form action="<wiki:Link jsp='LostPassword.jsp' format='url'><wiki:Param name='tab' value='lostpassword'/></wiki:Link>"
+<stripes:form action="/LostPassword.jsp"
           id="lostpw"
        class="wikiform"
-    onsubmit="return Wiki.submitOnce(this);"
-      method="post" accept-charset="<wiki:ContentEncoding />" >
+      method="post" acceptcharset="${wikiEngine.contentEncoding}" >
 
   <h3><fmt:message key="login.lostpw.heading" /></h3>
 
@@ -117,7 +111,7 @@
       <wiki:Messages div="information" topic="resetpw" prefix="" />
       <p>
         <fmt:message key="login.lostpw.reset.login">
-          <fmt:param><a href="<wiki:Link jsp='Login.jsp' />"><fmt:message key="login.lostpw.reset.clickhere"/></a></fmt:param>
+          <fmt:param><a href="<wiki:Link jsp='Login.action' />"><fmt:message key="login.lostpw.reset.clickhere"/></a></fmt:param>
         </fmt:message>
       </p>
   </c:when>
@@ -129,21 +123,21 @@
     <c:if test="${param.tab eq 'lostpassword'}" >
     <tr>
       <td colspan="2" class="formhelp">
-        <wiki:Messages div="error" topic="resetpw"
-                    prefix='<%=LocaleSupport.getLocalizedMessage(pageContext,"login.errorprefix")%>' />
+        <div class="error">
+          <stripes:errors beanclass="com.ecyrd.jspwiki.action.NoneActionBean"/>
+        </div>
         <wiki:Messages div="information" topic="resetpwok" />
       </td>
     </tr>
     </c:if>
     <tr>
       <td><label for="name"><fmt:message key="login.lostpw.name"/></label></td>
-      <td><input type="text" size="24" name="name" id="name" /></td>
+      <td><stripes:text size="24" name="name" id="name" /></td>
     </tr>
     <tr>
       <td>&nbsp;</td>
       <td>
-        <input type="hidden" name="action" value="resetPassword"/>
-        <input type="submit" name="Submit" value="<fmt:message key='login.lostpw.submit'/>" />
+        <stripes:submit name="resetPassword"><fmt:message key="login.lostpw.submit"/></stripes:submit>
       </td>
     </tr>
   </table>
@@ -169,7 +163,7 @@
   </c:otherwise>
   </c:choose>
 
-</form>
+</stripes:form>
 </div>
 
 </wiki:Tab>

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs/templates/default/ProfileTab.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs/templates/default/ProfileTab.jsp?rev=687533&r1=687532&r2=687533&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs/templates/default/ProfileTab.jsp (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs/templates/default/ProfileTab.jsp Wed Aug 20 18:24:07 2008
@@ -5,6 +5,7 @@
 <%@ page errorPage="/Error.jsp" %>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
+<%@ taglib uri="/WEB-INF/stripes.tld" prefix="stripes" %>
 <%@ page import="javax.servlet.jsp.jstl.fmt.*" %>
 <fmt:setLocale value="${prefs.Language}" />
 <fmt:setBundle basename="templates.default"/>
@@ -14,15 +15,11 @@
   UserManager manager = wikiContext.getEngine().getUserManager();
   UserProfile profile = manager.getUserProfile( wikiContext.getWikiSession() );
 %>
-<form action="<wiki:CheckRequestContext 
-     context='login'><wiki:Link jsp='Login.jsp' format='url'><wiki:Param name='tab'
-       value='profile'/></wiki:Link></wiki:CheckRequestContext><wiki:CheckRequestContext 
-     context='prefs'><wiki:Link jsp='UserPreferences.jsp' format='url'><wiki:Param name='tab'
-       value='profile'/></wiki:Link></wiki:CheckRequestContext>" 
-          id="editProfile" 
+<stripes:form beanclass="com.ecyrd.jspwiki.action.UserPreferencesActionBean"
+          id="editProfile"
        class="wikiform"
-    onsubmit="return Wiki.submitOnce( this );"
-      method="post" accept-charset="UTF-8">
+      method="post" acceptcharset="${wikiEngine.contentEncoding}">
+      <stripes:param name="tab" value="profile"/>
 
       <h3>
       <wiki:UserProfile property="exists"><fmt:message key="prefs.oldprofile"/></wiki:UserProfile>
@@ -42,8 +39,8 @@
        <td><label for="loginname"><fmt:message key="prefs.loginname"/></label></td>
        <td>
          <wiki:UserProfile property="canChangeLoginName">
-           <input type="text" name="loginname" id="loginname"
-                  size="20" value="<wiki:UserProfile property='loginname' />" />
+           <stripes:text name="loginname" id="loginname"
+                  size="20"><wiki:UserProfile property="loginname"/></stripes:text>
          </wiki:UserProfile>
          <wiki:UserProfile property="!canChangeLoginName">
            <!-- If user can't change their login name, it's because the container manages the login -->
@@ -64,16 +61,16 @@
          <td><label for="password"><fmt:message key="prefs.password"/></label></td>
          <td>
             <%--FIXME Enter Old PW to validate change flow, not yet treated by JSPWiki
-            <label for="password0">Old</label>&nbsp;
+            <label for="password">Old</label>&nbsp;
             <input type="password" name="password0" id="password0" size="20" value="" />
             &nbsp;&nbsp;--%>
-            <input type="password" name="password" id="password" size="20" value="" />
+            <stripes:password name="password" id="password" size="20" value="" />
           </td>
         </tr>
         <tr>
-          <td><label for="password2"><fmt:message key="prefs.password2"/></label></td>
+          <td><label for="passwordAgain"><fmt:message key="prefs.password2"/></label></td>
           <td>
-            <input type="password" name="password2" id="password2" size="20" value="" />
+            <stripes:password name="passwordAgain" id="passwordAgain" size="20" value="" />
             <%-- extra validation ? min size, allowed chars? --%>
          </td>
        </tr>
@@ -83,8 +80,8 @@
      <tr>
        <td><label for="fullname"><fmt:message key="prefs.fullname"/></label></td>
        <td>
-         <input type="text" name="fullname" id="fullname"
-                size="20" value="<wiki:UserProfile property='fullname'/>" />
+         <stripes:text name="fullname" id="fullname"
+                size="20"><wiki:UserProfile property="fullname"/></stripes:text>
          <span class="formhelp"><fmt:message key="prefs.fullname.description"/></span>
        </td>
      </tr>
@@ -93,8 +90,8 @@
      <tr>
        <td><label for="email"><fmt:message key="prefs.email"/></label></td>
        <td>
-         <input type="text" name="email" id="email"
-                size="20" value="<wiki:UserProfile property='email' />" />
+         <stripes:text name="email" id="email"
+                size="20"><wiki:UserProfile property="email" /></stripes:text>
          <span class="formhelp"><fmt:message key="prefs.email.description"/></span>
        </td>
      </tr>
@@ -133,13 +130,11 @@
        <td>&nbsp;</td>
        <td>
        <wiki:UserProfile property="exists">
-        <input type="submit" name="ok" value="<fmt:message key='prefs.save.submit' />" />
+        <stripes:submit name="saveProfile"><fmt:message key="prefs.save.submit"/></stripes:submit>
        </wiki:UserProfile>
        <wiki:UserProfile property="new">
-         <input type="submit" name="ok" value="<fmt:message key='prefs.save.submit' />" />
+        <stripes:submit name="saveProfile"><fmt:message key="prefs.save.submit"/></stripes:submit>
        </wiki:UserProfile>
-       <input type="hidden" name="redirect" value="<wiki:Variable var='redirect' default='' />" />
-       <input type="hidden" name="action" value="saveProfile" />
 
        <wiki:UserCheck status="assertionsAllowed">
           <div class="formhelp"><fmt:message key="prefs.cookie.info"/></div>
@@ -147,4 +142,4 @@
        </td>
      </tr>
    </table>
-</form>
+</stripes:form>

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/wikipages/en/Community.txt
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/wikipages/en/Community.txt?rev=687533&r1=687532&r2=687533&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/wikipages/en/Community.txt (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/wikipages/en/Community.txt Wed Aug 20 18:24:07 2008
@@ -15,7 +15,17 @@
 
 This is the list for JSPWiki developers.  Do not join if you fear geek-talk.  The jspwiki-dev list is hosted at Apache, so you join by sending an email to [jspwiki-dev-subscribe@incubator.apache.org|mailto:jspwiki-dev-subscribe@incubator.apache.org].  The list archives are at [http://mail-archives.apache.org/mod_mbox/incubator-jspwiki-dev/|http://mail-archives.apache.org/mod_mbox/incubator-jspwiki-dev/]
 
-The old JSPWiki-dev archives are [also available|http://www.ecyrd.com/pipermail/jspwiki-dev/], if you want to peruse some interesting issues.
+!JSPWiki-commits
+
+If you subscribe to this list you will get emailed when (a committer) commits new or changed files to the SVN repository.
+The jspwiki-commits list is hosted at Apache, join it by sending an email to [jspwiki-commits-subscribe@incubator.apache.org|mailto:jspwiki-commits-subscribe@incubator.apache.org].  
+The list archives are at http://mail-archives.apache.org/mod_mbox/incubator-jspwiki-commits/
+
+!Unsubscribing
+
+Unsubscribing is equally easy: you can just send an email to jspwiki-<user|dev|commits>-unsubscribe@incubator.apache.org from the same email address that you originally subscribed from. 
+
+The old JSPWiki-dev archives (up until Oct. 2007) are [also available|http://www.ecyrd.com/pipermail/jspwiki-dev/], if you want to peruse some interesting issues.
 
 !! Other resources
 

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/wikipages/en/InstallationTips.txt
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/wikipages/en/InstallationTips.txt?rev=687533&r1=687532&r2=687533&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/wikipages/en/InstallationTips.txt (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/wikipages/en/InstallationTips.txt Wed Aug 20 18:24:07 2008
@@ -5,17 +5,13 @@
 !Wiki configuration
 The least painful approach to defining the location of your Wiki files is to have them located at the same drive as your Tomcat (or other web server) installation, and define the location in Unix format. For example, files in C:\JSPWiki\files are defined in the configuration file as /JSPWiki/files.
 
-Make also sure to change the setting for {{log4j.appender.~FileLog.File}} in {{jspwiki.properties}} if you want a log-file to be created. This setting is hidden quite well near the end of the config-file. The format is the same as the {{jspwiki.fileSystemProvider.pageDir}}-setting, i.e. backslashes must be duplicated.
-
-!How To Link Tomcat 5 with IIS 6 on Windows 2003 Server using the JK2 ajp13 connector
-
-Comprehensive illustrated guide at [http://tjworld.net/help/kb/0001_iis6-Tomcat5-JK2.html#conConnector]
+Also make sure you change the setting for {{log4j.appender.~FileLog.File}} in {{jspwiki.properties}} if you want a logfile to be created. This setting is hidden quite well near the end of the config-file. The format is the same as the {{jspwiki.fileSystemProvider.pageDir}}-setting, i.e. backslashes must be duplicated.
 
 !! UTF-8 Issues
 
-If you are having problems with Tomcat 5.x and JSPWiki with UTF-8, please note the following!
+If you are having problems with Tomcat 5.x (or higher) and JSPWiki with UTF-8, please note the following!
 
-You have to edit server.xml of Tomcat (is in the conf-directory of Tomcat). Please add to 
+You have to edit the server.xml of Tomcat (located in the conf-directory of Tomcat). Please add to 
 
 {{{<Connector port="8080"
                maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
@@ -25,7 +21,7 @@
 
 the term '{{{URIEncoding="UTF-8"}}}'.
 
-It should look like that:
+It should look like this:
 
 {{{
 <Connector port="8080"
@@ -36,22 +32,9 @@
                URIEncoding="UTF-8"/>
 }}}
 
-Remember that if you use mod_jk, you should define the {{URIEncoding}} for the AJK Connector, too.
-
-------
-
-WARNING: Our Wikis running on 2.2.33 with jspwiki.properties set to UTF-8 did not display pages anymore that contained Umlaute after setting this. I had to disable the URIEncoding again.
-
---[Christoph Sauer|http://www.jspwiki.org/wiki/ChristophSauer] 2-Sep.2006
-------
-Using jk connector and Apache needs extra settings.
-
-This is my successful configuration.
-(Suse10.1 / Tomcat5.0 and 5.5 / JSPWiki v2.4.87)
+Remember that if you use mod_jk, you should define the {{URIEncoding}} for the JK Connector too :
 
-/etc/tomcat5/base/server.xml (based on "server-minimal.xml" by SuSE)
 {{{
-<Server port=8005 shutdown="SHUTDOWN">
 .........
   <service name="Catalina">
     <connector port="8080" />
@@ -59,9 +42,7 @@
     <connector protocol="AJP/1.3" uriencoding="UTF-8" port="8009" />
 .........
   </service>
-</server>
 }}}
---Kei Watanabe 10-jan.2007 / 21 Dec.2007
 
 !! Other tips
 
@@ -69,7 +50,7 @@
 
 The menu on the left hand side (over there <-----) is just a standard Wiki page, called [LeftMenu].
 
-If you (the administrator) don't want anyone else to modify it, you can always edit [LeftMenu], then make the page read-only on the hard drive itself ;-).
+If you (the administrator) don't want anyone else to modify it, you can always edit [LeftMenu], and then make the page read-only by putting an ACL on it.
 
 
 The lower part of the left hand side is similarly called [LeftMenuFooter], and it is fully editable as well.

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/wikipages/en/LeftMenu.txt
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/wikipages/en/LeftMenu.txt?rev=687533&r1=687532&r2=687533&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/wikipages/en/LeftMenu.txt (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/wikipages/en/LeftMenu.txt Wed Aug 20 18:24:07 2008
@@ -8,4 +8,4 @@
 * [Unused pages|UnusedPages]
 * [Undefined pages|UndefinedPages]
 * [Page Index]
-
+* [SystemInfo]

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/wikipages/en/LoginHelp.txt
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/wikipages/en/LoginHelp.txt?rev=687533&r1=687532&r2=687533&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/wikipages/en/LoginHelp.txt (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/wikipages/en/LoginHelp.txt Wed Aug 20 18:24:07 2008
@@ -1,5 +1,5 @@
 Here's a brief help on how to login to __[{$applicationname}]__. This text is [here|LoginHelp]. \\
-You can read more about JSPWiki's security features on the [documentation pages|http://doc.jspwiki.org/2.4/wiki/Security].
+You can read more about JSPWiki's security features on the [documentation pages|http://doc.jspwiki.org/2.8/wiki/Security].
 
 !!  Login
 
@@ -7,12 +7,12 @@
 
 || Status || Description || The User greeting Shows..
 | Anonymous | User not logged in, and has not supplied a cookie | "G'day (anonymous guest)"
-| Asserted | User's browser contains a cookie called {{~JSPWikiAssertedName}} | "G'Day, ''username'' (not logged in)"
-| Authenticated | User logged in with a login id and password | "G'Day, ''username'' (authenticated)"
+| Asserted | User's browser contains a cookie called {{~JSPWikiAssertedName}} | "G'day, ''username'' (not logged in)"
+| Authenticated | User logged in with a login id and password | "G'day, ''username'' (authenticated)"
 
 Depending on the default security policy and page access controls in place, users may (or may not) be required to authenticate. 
 
-When a user decides to log in — or is challenged to do so by a page access control or security policy — he or she sees a standard web form with a username field and a masked password field. After receiving the submitted web form, JSPWiki attempts to log the user.
+When a user decides to log in — or is challenged to do so by a page access control or security policy — he or she sees a standard web form with a username field and a masked password field. After receiving the submitted web form, JSPWiki attempts to log the user in.
 
 !! Lost password
 
@@ -30,8 +30,8 @@
 * The user's desired "wiki name" (e.g., JanneJalkanen). You can use this name in Access Control Lists or Wiki Groups
 * E-mail address. This can be used when you need to reset your password. (see Lost Password)
 
-If container-managed authentication is in force, the user ID will not be editable; the container will supply this value.
+If container-managed authentication is used, the user ID will not be editable; the container will supply this value.
 
 When the user saves the profile, JSPWiki checks to make sure that the new user id, wiki name and full name aren't already used by someone else. If so, the user is given the opportunity to choose different values.
 
-After a user creates a wiki profile, he or she may edit it at a later date via the ''My Prefs'' link. By default, users must be authenticated to edit their own profiles.
+After a user creates a wiki profile, he or she may edit it at a later time via the ''My Prefs'' link. By default, users must be authenticated to edit their own profiles.

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/wikipages/en/Main.txt
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/wikipages/en/Main.txt?rev=687533&r1=687532&r2=687533&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/wikipages/en/Main.txt (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/wikipages/en/Main.txt Wed Aug 20 18:24:07 2008
@@ -20,9 +20,6 @@
 * For all of the Wiki markup features, see [TextFormattingRules].
 * Entry point for full [JSPWikiDocumentation|http://www.jspwiki.org/wiki/JSPWikiDocumentation]
 ** [JSPWiki 2.6 New Features|http://www.jspwiki.org/wiki/NewIn2.6].
-** [JSPWiki 2.4.x|http://doc.jspwiki.org/2.4]. ([Security|http://doc.jspwiki.org/2.4/wiki/Security])
-** [Security2.3Howto|http://www.jspwiki.org/wiki/Security2.3Howto]
-** [JSPWiki 2.2.x|http://doc.jspwiki.org/2.2].
 
 !Miscellaneous
 

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/wikipages/en/PageIndex.txt
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/wikipages/en/PageIndex.txt?rev=687533&r1=687532&r2=687533&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/wikipages/en/PageIndex.txt (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/wikipages/en/PageIndex.txt Wed Aug 20 18:24:07 2008
@@ -1,4 +1,4 @@
-This is a list of all pages in this Wiki.
+This is an alphabetical list of all pages in this Wiki.
 
 ----
 



Mime
View raw message