Compile the jsp file into equivalent servlet in .java file @return A map of class names to JSR 045 source maps @throws Exception Error generating Java source
()
| 141 | * @throws Exception Error generating Java source |
| 142 | */ |
| 143 | protected Map<String,SmapStratum> generateJava() throws Exception { |
| 144 | |
| 145 | long t1 = 0; |
| 146 | long t2 = 0; |
| 147 | long t3 = 0; |
| 148 | long t4; |
| 149 | |
| 150 | if (log.isDebugEnabled()) { |
| 151 | t1 = System.currentTimeMillis(); |
| 152 | } |
| 153 | |
| 154 | // Setup page info area |
| 155 | pageInfo = new PageInfo(new BeanRepository(ctxt.getClassLoader(), errDispatcher), ctxt); |
| 156 | |
| 157 | JspConfig jspConfig = options.getJspConfig(); |
| 158 | JspConfig.JspProperty jspProperty = jspConfig.findJspProperty(ctxt.getJspFile()); |
| 159 | |
| 160 | /* |
| 161 | * If the current uri is matched by a pattern specified in a jsp-property-group in web.xml, initialize pageInfo |
| 162 | * with those properties. |
| 163 | */ |
| 164 | if (jspProperty.isELIgnored() != null) { |
| 165 | pageInfo.setELIgnored(JspUtil.booleanValue(jspProperty.isELIgnored())); |
| 166 | } |
| 167 | if (jspProperty.getErrorOnELNotFound() != null) { |
| 168 | pageInfo.setErrorOnELNotFound(JspUtil.booleanValue(jspProperty.getErrorOnELNotFound())); |
| 169 | } |
| 170 | if (jspProperty.isScriptingInvalid() != null) { |
| 171 | pageInfo.setScriptingInvalid(JspUtil.booleanValue(jspProperty.isScriptingInvalid())); |
| 172 | } |
| 173 | if (jspProperty.getIncludePrelude() != null) { |
| 174 | pageInfo.setIncludePrelude(jspProperty.getIncludePrelude()); |
| 175 | } |
| 176 | if (jspProperty.getIncludeCoda() != null) { |
| 177 | pageInfo.setIncludeCoda(jspProperty.getIncludeCoda()); |
| 178 | } |
| 179 | if (jspProperty.isDeferedSyntaxAllowedAsLiteral() != null) { |
| 180 | pageInfo.setDeferredSyntaxAllowedAsLiteral( |
| 181 | JspUtil.booleanValue(jspProperty.isDeferedSyntaxAllowedAsLiteral())); |
| 182 | } |
| 183 | if (jspProperty.isTrimDirectiveWhitespaces() != null) { |
| 184 | pageInfo.setTrimDirectiveWhitespaces(JspUtil.booleanValue(jspProperty.isTrimDirectiveWhitespaces())); |
| 185 | } |
| 186 | // Default ContentType processing is deferred until after the page has |
| 187 | // been parsed |
| 188 | if (jspProperty.getBuffer() != null) { |
| 189 | pageInfo.setBufferValue(jspProperty.getBuffer(), null, errDispatcher); |
| 190 | } |
| 191 | if (jspProperty.isErrorOnUndeclaredNamespace() != null) { |
| 192 | pageInfo.setErrorOnUndeclaredNamespace(JspUtil.booleanValue(jspProperty.isErrorOnUndeclaredNamespace())); |
| 193 | } |
| 194 | if (ctxt.isTagFile()) { |
| 195 | try { |
| 196 | double libraryVersion = Double.parseDouble(ctxt.getTagInfo().getTagLibrary().getRequiredVersion()); |
| 197 | if (libraryVersion < 2.0) { |
| 198 | pageInfo.setIsELIgnored("true", null, errDispatcher, true); |
| 199 | } |
| 200 | if (libraryVersion < 2.1) { |
no test coverage detected