org.archive.wayback.replay.html.rules
Class AfterBodyStartTagJSPExecRule

java.lang.Object
  extended by org.archive.wayback.replay.html.rules.JSPExecRule
      extended by org.archive.wayback.replay.html.rules.AfterBodyStartTagJSPExecRule
All Implemented Interfaces:
ReplayParseEventDelegatorVisitor, OpenTagHandler

public class AfterBodyStartTagJSPExecRule
extends JSPExecRule
implements ReplayParseEventDelegatorVisitor, OpenTagHandler

This Rule fires just after the BODY start tag, emitting the result of the replay .jsp into the resulting page at that point. Sounds simple, BUT, it's possible there is no BODY start tag... In case this happens, we watch *ALL* tags go by, before they've been output, and if we see any start tags not of the following types: html,head,base,link,meta,title,style,script we emit our content then and there. We also ensure we don't emit twice by storing a flag in the ParseContext once we do emit. Lastly, if we see a "FRAMESET" tag in the page, we hold off on inserting our content.

Author:
brad

Constructor Summary
AfterBodyStartTagJSPExecRule()
           
 
Method Summary
 void emit(ReplayParseContext context, org.htmlparser.Node node)
           
 void handleOpenTagNode(ParseContext pContext, org.htmlparser.nodes.TagNode node)
           
 void visit(ReplayParseEventDelegator rules)
           
 
Methods inherited from class org.archive.wayback.replay.html.rules.JSPExecRule
getJspPath, setJspPath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AfterBodyStartTagJSPExecRule

public AfterBodyStartTagJSPExecRule()
Method Detail

visit

public void visit(ReplayParseEventDelegator rules)
Specified by:
visit in interface ReplayParseEventDelegatorVisitor

emit

public void emit(ReplayParseContext context,
                 org.htmlparser.Node node)
          throws IOException
Overrides:
emit in class JSPExecRule
Throws:
IOException

handleOpenTagNode

public void handleOpenTagNode(ParseContext pContext,
                              org.htmlparser.nodes.TagNode node)
                       throws IOException
Specified by:
handleOpenTagNode in interface OpenTagHandler
Throws:
IOException


Copyright © 2005-2011 Internet Archive. All Rights Reserved.