org.apache.jasper.compiler
Class SmapUtil
public
class
SmapUtil
extends Object
Contains static utilities for generating SMAP data based on the
current version of Jasper.
Author: Jayson Falkner Shawn Bayern Robert Field (inner SDEInstaller class) Mark Roth Kin-man Chung
public static final String SMAP_ENCODING
public static void evaluateNodes(
Node.
Nodes nodes,
SmapStratum s, HashMap innerClassMap, boolean breakAtLF)
Generates an appropriate SMAP representing the current compilation
context. (JSR-045.)
Parameters: ctxt Current compilation context pageNodes The current JSP page
Returns: a SMAP for the page
public static void installSmap(String[] smap)
Disable reading of input SMAP because:
1. There is a bug here: getRealPath() is null if .jsp is in a jar
Bugzilla 14660.
2. Mappings from other sources into .jsp files are not supported.
TODO: fix 1. if 2. is not true.
// determine if we have an input SMAP
String smapPath = inputSmapPath(ctxt.getRealPath(ctxt.getJspFile()));
File inputSmap = new File(smapPath);
if (inputSmap.exists()) {
byte[] embeddedSmap = null;
byte[] subSmap = SDEInstaller.readWhole(inputSmap);
String subSmapString = new String(subSmap, SMAP_ENCODING);
g.addSmap(subSmapString, "JSP");
}
Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.