cziegeler 2003/12/12 03:53:50
Modified: src/blocks/portal/java/org/apache/cocoon/portal/acting
BookmarkAction.java
Log:
Clean up history when the user goes back
Revision Changes Path
1.3 +6 -2
cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/acting/BookmarkAction.java
Index: BookmarkAction.java
===================================================================
RCS file:
/home/cvs/cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/acting/BookmarkAction.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- BookmarkAction.java 12 Dec 2003 10:13:34 -0000 1.2
+++ BookmarkAction.java 12 Dec 2003 11:53:50 -0000 1.3
@@ -211,12 +211,16 @@
// get the history
final List history =
(List)session.getAttribute("portal-history");
if ( history != null ) {
- final List state =
(List)history.get(Integer.parseInt(historyValue));
+ final int index = Integer.parseInt(historyValue);
+ final List state = (List)history.get(index);
if ( state != null ) {
final Iterator iter = state.iterator();
while ( iter.hasNext() ) {
Mapping m = (Mapping)iter.next();
events.add(m.getEvent(service, null));
+ }
+ while (history.size() > index ) {
+ history.remove(history.size()-1);
}
}
}