TransactionRecord tempPageRecord = (TransactionRecord)pageRecordEntry.getValue(); String transactionRecordKey = tempPageRecord.key(); if (pageCacheKey.equals(transactionRecordKey)) { existingPageRecordEntry = pageRecordEntry;
TransactionRecord tempPageRecord = (TransactionRecord)pageRecordEntry.getValue(); WOComponent tempPage = tempPageRecord.page(); WOContext tempContext = tempPageRecord.context();  if (tempPage == null || tempContext == null) {
    public void savePage(WOComponent page) {      WOContext context = context();      WOResponse response = context.response();      if (response != null && (response.headerForKey(ERXSession.DONT_STORE_PAGE) != null || (response.userInfo() != null && response.userInfo().objectForKey(ERXSession.DONT_STORE_PAGE) != null))) {        String pageCacheKey = response.headerForKey(ERXSession.PAGE_REPLACEMENT_CACHE_LOOKUP_KEY);        if (pageCacheKey != null) {          String originalContextID = context.request().headerForKey(ERXSession.ORIGINAL_CONTEXT_ID_KEY);          pageCacheKey = originalContextID + "_" + pageCacheKey;          //System.out.println("Session.savePage: page cache key = " + pageCacheKey);          LinkedHashMap pageReplacementCache = (LinkedHashMap) objectForKey(ERXSession.PAGE_REPLACEMENT_CACHE_KEY);          if (pageReplacementCache == null) {            pageReplacementCache = new LinkedHashMap();            setObjectForKey(pageReplacementCache, ERXSession.PAGE_REPLACEMENT_CACHE_KEY);          }          Map.Entry existingPageRecordEntry = null;          Iterator transactionRecordsEnum = pageReplacementCache.entrySet().iterator();          while (existingPageRecordEntry == null && transactionRecordsEnum.hasNext()) {            Map.Entry pageRecordEntry = (Map.Entry)transactionRecordsEnum.next();           TransactionRecord tempPageRecord = (TransactionRecord)pageRecordEntry.getValue();            String transactionRecordKey = tempPageRecord.key();            if (pageCacheKey.equals(transactionRecordKey)) {              existingPageRecordEntry = pageRecordEntry;              //System.out.println("Session.savePage:   replacing old page for " + pageCacheKey);              transactionRecordsEnum.remove();            }          }          if (existingPageRecordEntry == null && pageReplacementCache.size() >= ERXSession.MAX_PAGE_REPLACEMENT_CACHE_SIZE) {            Iterator entryIterator = pageReplacementCache.entrySet().iterator();            Map.Entry oldestEntry = (Map.Entry) entryIterator.next();            entryIterator.remove();            //System.out.println("Session.savePage:   removing oldest entry: " + ((ERTransactionRecord)oldestEntry.getValue()).key());          }                    //System.out.println("Session.savePage:   adding page for key " + pageCacheKey);          TransactionRecord pageRecord = new TransactionRecord(page, context, pageCacheKey);          pageReplacementCache.put(context.contextID(), pageRecord);        }      }      else {        super.savePage(page);      }    }