@Override public String getServletFileNameForJsp(Context context, String jspName) { String servletName = null; ServletConfig servletConfig = (ServletConfig) context.findChild("jsp"); if (servletConfig != null) { ServletContext sctx = context.getServletContext(); Options opt = new EmbeddedServletOptions(servletConfig, sctx); JspRuntimeContext jrctx = new JspRuntimeContext(sctx, opt); JspCompilationContext jcctx = createJspCompilationContext(jspName, opt, sctx, jrctx, null); servletName = jcctx.getServletJavaFileName(); } else { logger.error(NO_JSP_SERVLET, context.getName()); } return servletName; }
Options opt = new EmbeddedServletOptions(servletConfig, sctx); JspRuntimeContext jrctx = new JspRuntimeContext(sctx, opt); try { if (summary.getItems() == null) {
Options opt = new EmbeddedServletOptions(servletConfig, sctx); JspRuntimeContext jrctx = new JspRuntimeContext(sctx, opt);
protected void initServletContext() { try { context =new JspCServletContext (new PrintWriter(System.out), new URL("file:" + uriRoot.replace('\\','/') + '/')); tldLocationsCache = TldLocationsCache.getInstance(context); } catch (MalformedURLException me) { System.out.println("**" + me); } rctxt = new JspRuntimeContext(context, this); jspConfig = new JspConfig(context); tagPluginManager = new TagPluginManager(context); }
protected void initServletContext() { try { context =new JspCServletContext (new PrintWriter(System.out), new URL("file:" + uriRoot.replace('\\','/') + '/')); tldLocationsCache = new TldLocationsCache(context); } catch (MalformedURLException me) { System.out.println("**" + me); } rctxt = new JspRuntimeContext(context, this); jspConfig = new JspConfig(context); tagPluginManager = new TagPluginManager(context); }
private void initServletContext() { try { context =new JspCServletContext (new PrintWriter(new OutputStreamWriter(System.out, "UTF-8")), new URL("file:" + uriRoot.replace('\\','/') + '/')); tldScanner = new TldScanner(context, isValidationEnabled); // START GlassFish 750 taglibs = new ConcurrentHashMap<String, TagLibraryInfo>(); context.setAttribute(Constants.JSP_TAGLIBRARY_CACHE, taglibs); tagFileJarUrls = new ConcurrentHashMap<String, URL>(); context.setAttribute(Constants.JSP_TAGFILE_JAR_URLS_CACHE, tagFileJarUrls); // END GlassFish 750 } catch (MalformedURLException me) { System.out.println("**" + me); } catch (UnsupportedEncodingException ex) { } rctxt = new JspRuntimeContext(context, this); jspConfig = new JspConfig(context); tagPluginManager = new TagPluginManager(context); }
rctxt = new JspRuntimeContext(context,options);
rctxt = new JspRuntimeContext(context,options);
rctxt = new JspRuntimeContext(context,options);
private void initServletContext() { try { context =new JspCServletContext (new PrintWriter(new OutputStreamWriter(System.out, "UTF-8")), new URL("file:" + uriRoot.replace('\\','/') + '/')); tldScanner = new TldScanner(context, isValidationEnabled); // START GlassFish 750 taglibs = new ConcurrentHashMap<String, TagLibraryInfo>(); context.setAttribute(Constants.JSP_TAGLIBRARY_CACHE, taglibs); tagFileJarUrls = new ConcurrentHashMap<String, URL>(); context.setAttribute(Constants.JSP_TAGFILE_JAR_URLS_CACHE, tagFileJarUrls); // END GlassFish 750 } catch (MalformedURLException me) { System.out.println("**" + me); } catch (UnsupportedEncodingException ex) { } rctxt = new JspRuntimeContext(context, this); jspConfig = new JspConfig(context); tagPluginManager = new TagPluginManager(context); }
rctxt = new JspRuntimeContext(context, options);
private void initServletContext() { try { context =new JspCServletContext (new PrintWriter(new OutputStreamWriter(System.out, "UTF-8")), new URL("file:" + uriRoot.replace('\\','/') + '/')); tldScanner = new TldScanner(context, isValidationEnabled); // START GlassFish 750 taglibs = new ConcurrentHashMap<String, TagLibraryInfo>(); context.setAttribute(Constants.JSP_TAGLIBRARY_CACHE, taglibs); tagFileJarUrls = new ConcurrentHashMap<String, URL>(); context.setAttribute(Constants.JSP_TAGFILE_JAR_URLS_CACHE, tagFileJarUrls); // END GlassFish 750 } catch (MalformedURLException me) { System.out.println("**" + me); } catch (UnsupportedEncodingException ex) { } rctxt = new JspRuntimeContext(context, this); jspConfig = new JspConfig(context); tagPluginManager = new TagPluginManager(context); }
private void initServletContext() { try { context =new JspCServletContext (new PrintWriter(System.out), new URL("file:" + uriRoot.replace('\\','/') + '/')); tldScanner = new TldScanner(context, isValidationEnabled); // START GlassFish 750 taglibs = new ConcurrentHashMap<String, TagLibraryInfo>(); context.setAttribute(Constants.JSP_TAGLIBRARY_CACHE, taglibs); tagFileJarUrls = new ConcurrentHashMap<String, URL>(); context.setAttribute(Constants.JSP_TAGFILE_JAR_URLS_CACHE, tagFileJarUrls); // END GlassFish 750 } catch (MalformedURLException me) { System.out.println("**" + me); } rctxt = new JspRuntimeContext(context, this); jspConfig = new JspConfig(context); tagPluginManager = new TagPluginManager(context); }
private void initServletContext() { try { context =new JspCServletContext (new PrintWriter(System.out), new URL("file:" + uriRoot.replace('\\','/') + '/')); tldScanner = new TldScanner(context, isValidationEnabled); // START GlassFish 750 taglibs = new ConcurrentHashMap<String, TagLibraryInfo>(); context.setAttribute(Constants.JSP_TAGLIBRARY_CACHE, taglibs); tagFileJarUrls = new ConcurrentHashMap<String, URL>(); context.setAttribute(Constants.JSP_TAGFILE_JAR_URLS_CACHE, tagFileJarUrls); // END GlassFish 750 } catch (MalformedURLException me) { System.out.println("**" + me); } rctxt = new JspRuntimeContext(context, this); jspConfig = new JspConfig(context); tagPluginManager = new TagPluginManager(context); }
private void initServletContext() { try { context =new JspCServletContext (new PrintWriter(System.out), new URL("file:" + uriRoot.replace('\\','/') + '/')); tldScanner = new TldScanner(context, isValidationEnabled); // START GlassFish 750 taglibs = new ConcurrentHashMap<String, TagLibraryInfo>(); context.setAttribute(Constants.JSP_TAGLIBRARY_CACHE, taglibs); tagFileJarUrls = new ConcurrentHashMap<String, URL>(); context.setAttribute(Constants.JSP_TAGFILE_JAR_URLS_CACHE, tagFileJarUrls); // END GlassFish 750 } catch (MalformedURLException me) { System.out.println("**" + me); } rctxt = new JspRuntimeContext(context, this); jspConfig = new JspConfig(context); tagPluginManager = new TagPluginManager(context); }
System.out.println("**" + me); rctxt = new JspRuntimeContext(context, this);
private void compileJsp(JspCompilationInfo info) throws Exception { assertTrue("Source file " + new File(info.getJspSource()).getAbsolutePath() + " does not exist", new File(info.getJspSource()).exists()); PrintWriter logWriter = new PrintWriter(new StringWriter()); URL baseUrl = new File(info.getWebRoot()).toURL(); ServletContext sContext = new JspCServletContext(logWriter, baseUrl); ServletConfig sConfig = new MockServletConfig(sContext); Options options = createOptions(sContext, sConfig, info); JspRuntimeContext rtContext = new JspRuntimeContext(sContext, options); JspServletWrapper sWrapper = makeWrapper(sContext, options, rtContext); JspCompilationContext cContext = createJspCompilationContext(info, sContext, options, rtContext, sWrapper, new StringWriter()); logCompilation(info.getJspSource(), info.getClassOutputDir()); compileJspToJava(sWrapper, cContext); File javaFile = new File(info.getJavaSource()); assertTrue("Failed to generate .java source code to " + javaFile.getAbsolutePath(), javaFile.exists()); info.compilationWasSuccessful(); }
private void compileJsp(JspCompilationInfo info) throws Exception { assertTrue("Source file " + new File(info.getJspSource()).getAbsolutePath() + " does not exist", new File(info.getJspSource()).exists()); PrintWriter logWriter = new PrintWriter(new StringWriter()); URL baseUrl = new File(info.getWebRoot()).toURL(); ServletContext sContext = new JspCServletContext(logWriter, baseUrl); ServletConfig sConfig = new MockServletConfig(sContext); Options options = createOptions(sContext, sConfig, info); JspRuntimeContext rtContext = new JspRuntimeContext(sContext, options); JspServletWrapper sWrapper = makeWrapper(sContext, options, rtContext); JspCompilationContext cContext = createJspCompilationContext(info, sContext, options, rtContext, sWrapper, new StringWriter()); logCompilation(info.getJspSource(), info.getClassOutputDir()); compileJspToJava(sWrapper, cContext); File javaFile = new File(info.getJavaSource()); assertTrue("Failed to generate .java source code to " + javaFile.getAbsolutePath(), javaFile.exists()); info.compilationWasSuccessful(); }
protected void initServletContext(ClassLoader classLoader) throws IOException, JasperException { // TODO: should we use the Ant Project's log? PrintWriter log = new PrintWriter(System.out); URL resourceBase = new File(uriRoot).getCanonicalFile().toURI().toURL(); context = new JspCServletContext(log, resourceBase, classLoader, isValidateXml(), isBlockExternal()); if (isValidateTld()) { context.setInitParameter(Constants.XML_VALIDATION_TLD_INIT_PARAM, "true"); } initTldScanner(context, classLoader); try { scanner.scan(); } catch (SAXException e) { throw new JasperException(e); } tldCache = new TldCache(context, scanner.getUriTldResourcePathMap(), scanner.getTldResourcePathTaglibXmlMap()); context.setAttribute(TldCache.SERVLET_CONTEXT_ATTRIBUTE_NAME, tldCache); rctxt = new JspRuntimeContext(context, this); jspConfig = new JspConfig(context); tagPluginManager = new TagPluginManager(context); }
protected void initServletContext(ClassLoader classLoader) throws IOException, JasperException { // TODO: should we use the Ant Project's log? PrintWriter log = new PrintWriter(System.out); URL resourceBase = new File(uriRoot).getCanonicalFile().toURI().toURL(); context = new JspCServletContext(log, resourceBase, classLoader); if (isValidateTld()) { context.setInitParameter(Constants.XML_VALIDATION_TLD_INIT_PARAM, "true"); } if (isBlockExternal()) { context.setInitParameter(Constants.XML_BLOCK_EXTERNAL_INIT_PARAM, "true"); } TldScanner scanner = new TldScanner( context, true, isValidateTld(), isBlockExternal()); scanner.setClassLoader(classLoader); try { scanner.scan(); } catch (SAXException e) { throw new JasperException(e); } tldCache = new TldCache(context, scanner.getUriTldResourcePathMap(), scanner.getTldResourcePathTaglibXmlMap()); context.setAttribute(TldCache.SERVLET_CONTEXT_ATTRIBUTE_NAME, tldCache); rctxt = new JspRuntimeContext(context, this); jspConfig = new JspConfig(context); tagPluginManager = new TagPluginManager(context); }