in my environment the concatenation bug is still there after this patch. I looked at the sources for a few hours, but can't find the cause yet, ContentManager.pageExists() works correctly as far as I can judge.
regards, Harry 2009/11/4 <[email protected]> > Author: ajaquith > Date: Wed Nov 4 03:17:42 2009 > New Revision: 832652 > > URL: http://svn.apache.org/viewvc?rev=832652&view=rev > Log: > Fixed bug causing concatenation of edited page text. Root cause: over-eager > use of flash-scope in EditActionBean. Upgraded Stripes to 1.6-beta. > > Added: > > incubator/jspwiki/trunk/src/WebContent/WEB-INF/lib/stripes-1.6-svn-1193.jar > (with props) > Removed: > > incubator/jspwiki/trunk/src/WebContent/WEB-INF/lib/stripes-1.5.2-beta.jar > Modified: > incubator/jspwiki/trunk/ChangeLog > incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java > > incubator/jspwiki/trunk/src/java/org/apache/wiki/action/EditActionBean.java > > > incubator/jspwiki/trunk/tests/java/org/apache/wiki/action/EditActionBeanTest.java > > > incubator/jspwiki/trunk/tests/java/org/apache/wiki/ui/stripes/ShortUrlRedirectFilterTest.java > > Modified: incubator/jspwiki/trunk/ChangeLog > URL: > http://svn.apache.org/viewvc/incubator/jspwiki/trunk/ChangeLog?rev=832652&r1=832651&r2=832652&view=diff > > ============================================================================== > --- incubator/jspwiki/trunk/ChangeLog (original) > +++ incubator/jspwiki/trunk/ChangeLog Wed Nov 4 03:17:42 2009 > @@ -1,3 +1,11 @@ > +2009-11-03 Andrew Jaquith <ajaquith AT apache DOT org> > + > + * 3.0.0-svn-177 > + > + * Fixed bug causing concatenation of edited page text. > + Root cause: over-eager use of flash-scope in EditActionBean. > + Upgraded Stripes to 1.6-beta. > + > 2009-11-01 Andrew Jaquith <ajaquith AT apache DOT org> > > * 3.0.0-svn-176 > > Added: > incubator/jspwiki/trunk/src/WebContent/WEB-INF/lib/stripes-1.6-svn-1193.jar > URL: > http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/WebContent/WEB-INF/lib/stripes-1.6-svn-1193.jar?rev=832652&view=auto > > ============================================================================== > Binary file - no diff available. > > Propchange: > incubator/jspwiki/trunk/src/WebContent/WEB-INF/lib/stripes-1.6-svn-1193.jar > > ------------------------------------------------------------------------------ > svn:mime-type = application/octet-stream > > Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java > URL: > http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java?rev=832652&r1=832651&r2=832652&view=diff > > ============================================================================== > --- incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java > (original) > +++ incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java Wed Nov > 4 03:17:42 2009 > @@ -77,7 +77,7 @@ > * <p> > * If the build identifier is empty, it is not added. > */ > - public static final String BUILD = "176"; > + public static final String BUILD = "177"; > > /** > * This is the generic version string you should use > > Modified: > incubator/jspwiki/trunk/src/java/org/apache/wiki/action/EditActionBean.java > URL: > http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/action/EditActionBean.java?rev=832652&r1=832651&r2=832652&view=diff > > ============================================================================== > --- > incubator/jspwiki/trunk/src/java/org/apache/wiki/action/EditActionBean.java > (original) > +++ > incubator/jspwiki/trunk/src/java/org/apache/wiki/action/EditActionBean.java > Wed Nov 4 03:17:42 2009 > @@ -530,10 +530,7 @@ > } > catch( RedirectException ex ) > { > - // Should work, but doesn't > - wikiContext.getWikiSession().addMessage( ex.getMessage() ); // > FIXME: > - session.setAttribute( "message", ex.getMessage() ); > - return new RedirectResolution( ex.getRedirect() ).flash( this > ); > + throw new WikiException("Strange redirection: " + > ex.getMessage(), ex); > } > > return new RedirectResolution( ViewActionBean.class, "view" > ).addParameter( "page", pagereq ); > > Modified: > incubator/jspwiki/trunk/tests/java/org/apache/wiki/action/EditActionBeanTest.java > URL: > http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/org/apache/wiki/action/EditActionBeanTest.java?rev=832652&r1=832651&r2=832652&view=diff > > ============================================================================== > --- > incubator/jspwiki/trunk/tests/java/org/apache/wiki/action/EditActionBeanTest.java > (original) > +++ > incubator/jspwiki/trunk/tests/java/org/apache/wiki/action/EditActionBeanTest.java > Wed Nov 4 03:17:42 2009 > @@ -133,9 +133,26 @@ > ValidationErrors errors = trip.getValidationErrors(); > assertEquals( 0, errors.size() ); > assertEquals( page, bean.getPage() ); > + assertEquals( "This is the edited text\r\n", > page.getContentAsString() ); > > // ...and the destination should be Wiki.action (aka display JSP) > assertEquals( "/Wiki.action?view=&page=" + pageName, > trip.getDestination() ); > + > + // Save the page one more time! > + trip = m_engine.guestTrip( "/Edit.action" ); > + trip.setParameter( "page", pageName ); > + startTime = String.valueOf( System.currentTimeMillis() ); > + trip.addParameter( "startTime", CryptoUtil.encrypt( startTime ) ); > + trip.addParameter( "text", "This is the third revision." ); > + TestEngine.addSpamProtectParams( trip ); > + trip.execute( "save" ); > + > + // ...and the text should again be the same as our revision > + bean = trip.getActionBean( EditActionBean.class ); > + errors = trip.getValidationErrors(); > + assertEquals( 0, errors.size() ); > + assertEquals( page, bean.getPage() ); > + assertEquals( "This is the third revision.\r\n", > page.getContentAsString() ); > > // Delete the test page > m_engine.deletePage( pageName ); > > Modified: > incubator/jspwiki/trunk/tests/java/org/apache/wiki/ui/stripes/ShortUrlRedirectFilterTest.java > URL: > http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/org/apache/wiki/ui/stripes/ShortUrlRedirectFilterTest.java?rev=832652&r1=832651&r2=832652&view=diff > > ============================================================================== > --- > incubator/jspwiki/trunk/tests/java/org/apache/wiki/ui/stripes/ShortUrlRedirectFilterTest.java > (original) > +++ > incubator/jspwiki/trunk/tests/java/org/apache/wiki/ui/stripes/ShortUrlRedirectFilterTest.java > Wed Nov 4 03:17:42 2009 > @@ -47,12 +47,10 @@ > > // Add extension classes > Map<String,String> filterParams = new HashMap<String,String>(); > -// filterParams.put("ActionResolver.Class", > "org.apache.wiki.ui.stripes.FileBasedActionResolver"); > filterParams.put("ActionResolver.Packages", > "org.apache.wiki.action"); > filterParams.put("Extension.Packages", > "org.apache.wiki.ui.stripes"); > filterParams.put( "ExceptionHandler.Class", > "org.apache.wiki.ui.stripes.WikiExceptionHandler" ); > servletContext.addFilter(StripesFilter.class, "StripesFilter", > filterParams); > - > servletContext.addFilter( ShortUrlRedirectFilter.class, "Redirect > filter", null ); > > // Set the configured servlet context > > >
