Revision: 3150 http://archive-access.svn.sourceforge.net/archive-access/?rev=3150&view=rev Author: bradtofel Date: 2010-06-05 01:16:53 +0000 (Sat, 05 Jun 2010) Log Message: ----------- BUGFIX: added another possible CDATA with immediate comment tag to OKHeadTags Modified Paths: -------------- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/archivalurl/FastArchivalUrlReplayParseEventHandler.java Modified: trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/archivalurl/FastArchivalUrlReplayParseEventHandler.java =================================================================== --- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/archivalurl/FastArchivalUrlReplayParseEventHandler.java 2010-06-05 01:15:48 UTC (rev 3149) +++ trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/archivalurl/FastArchivalUrlReplayParseEventHandler.java 2010-06-05 01:16:53 UTC (rev 3150) @@ -63,9 +63,11 @@ FastArchivalUrlReplayParseEventHandler.class.toString(); private String jspInsertPath = "/WEB-INF/replay/DisclaimChooser.jsp"; + private String commentJsp = "/WEB-INF/replay/ArchiveComment.jsp"; - private final String[] okHeadTags = { "![CDATA[*", "!DOCTYPE", "HTML", "HEAD", "BASE", - "LINK", "META", "TITLE", "STYLE", "SCRIPT" }; + private final String[] okHeadTags = { "![CDATA[*", "![CDATA[", "?", + "!DOCTYPE", "HTML", "HEAD", "BASE", "LINK", "META", "TITLE", + "STYLE", "SCRIPT" }; private HashMap<String, Object> okHeadTagMap = null; private final static String FRAMESET_TAG = "FRAMESET"; private final static String BODY_TAG = "BODY"; @@ -203,6 +205,8 @@ if(orig != null) { try { context.setBaseUrl(new URL(orig)); + transformAttr(context, tagNode, "HREF", anchorUrlTrans); + } catch (MalformedURLException e) { e.printStackTrace(); } @@ -326,8 +330,21 @@ } return false; } - public void handleParseComplete(ParseContext context) throws IOException { - // Nothing to do. + public void handleParseComplete(ParseContext pContext) throws IOException { + if(commentJsp != null) { + ReplayParseContext context = (ReplayParseContext) pContext; + OutputStream out = context.getOutputStream(); + String tmp = null; + try { + tmp = context.getJspExec().jspToString(commentJsp); + } catch (ServletException e) { + e.printStackTrace(); + } + if(tmp != null) { + Charset charset = Charset.forName(context.getOutputCharset()); + out.write(tmp.getBytes(charset)); + } + } } /** @@ -343,4 +360,18 @@ public void setJspInsertPath(String jspInsertPath) { this.jspInsertPath = jspInsertPath; } + + /** + * @return the commentJsp + */ + public String getCommentJsp() { + return commentJsp; + } + + /** + * @param commentJsp the commentJsp to set + */ + public void setCommentJsp(String commentJsp) { + this.commentJsp = commentJsp; + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |