Java源码示例:org.apache.jasper.compiler.JspRuntimeContext

示例1
JspServletWrapper(ServletConfig config, Options options, String jspUri,
                     boolean isErrorPage, JspRuntimeContext rctxt)
           throws JasperException {

this.isTagFile = false;
       this.config = config;
       this.options = options;
       this.jspUri = jspUri;
       this.jspProbeEmitter = (JspProbeEmitter)
           config.getServletContext().getAttribute(
               "org.glassfish.jsp.monitor.probeEmitter");

       ctxt = new JspCompilationContext(jspUri, isErrorPage, options,
				 config.getServletContext(),
				 this, rctxt);
       // START PWC 6468930
       String jspFilePath = ctxt.getRealPath(jspUri);
       if (jspFilePath != null) {
           jspFile = new File(jspFilePath);
       }
       // END PWC 6468930
   }
 
示例2
public JspServletWrapper(ServletContext servletContext,
                         Options options,
                         String tagFilePath,
                         TagInfo tagInfo,
                         JspRuntimeContext rctxt,
                         Jar tagJar) {

    this.isTagFile = true;
    this.config = null;        // not used
    this.options = options;
    this.jspUri = tagFilePath;
    this.tripCount = 0;
    unloadByCount = options.getMaxLoadedJsps() > 0 ? true : false;
    unloadByIdle = options.getJspIdleTimeout() > 0 ? true : false;
    unloadAllowed = unloadByCount || unloadByIdle ? true : false;
    ctxt = new JspCompilationContext(jspUri, tagInfo, options,
                                     servletContext, this, rctxt,
                                     tagJar);
}
 
示例3
public JspServletWrapper(ServletContext servletContext,
                         Options options,
                         String tagFilePath,
                         TagInfo tagInfo,
                         JspRuntimeContext rctxt,
                         JarResource tagJarResource) {

    this.isTagFile = true;
    this.config = null;        // not used
    this.options = options;
    this.jspUri = tagFilePath;
    this.tripCount = 0;
    unloadByCount = options.getMaxLoadedJsps() > 0 ? true : false;
    unloadByIdle = options.getJspIdleTimeout() > 0 ? true : false;
    unloadAllowed = unloadByCount || unloadByIdle ? true : false;
    ctxt = new JspCompilationContext(jspUri, tagInfo, options,
                                     servletContext, this, rctxt,
                                     tagJarResource);
}
 
示例4
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 (isValidateXml()) {
        context.setInitParameter(Constants.XML_VALIDATION_INIT_PARAM, "true");
    }
    context.setInitParameter(Constants.XML_BLOCK_EXTERNAL_INIT_PARAM,
            String.valueOf(isBlockExternal()));

    tldLocationsCache = TldLocationsCache.getInstance(context);
    rctxt = new JspRuntimeContext(context, this);
    jspConfig = new JspConfig(context);
    tagPluginManager = new TagPluginManager(context);
}
 
示例5
public JspServletWrapper(ServletContext servletContext,
                         Options options,
                         String tagFilePath,
                         TagInfo tagInfo,
                         JspRuntimeContext rctxt,
                         JarResource tagJarResource) {

    this.isTagFile = true;
    this.config = null;        // not used
    this.options = options;
    this.jspUri = tagFilePath;
    this.tripCount = 0;
    unloadByCount = options.getMaxLoadedJsps() > 0 ? true : false;
    unloadByIdle = options.getJspIdleTimeout() > 0 ? true : false;
    unloadAllowed = unloadByCount || unloadByIdle ? true : false;
    ctxt = new JspCompilationContext(jspUri, tagInfo, options,
                                     servletContext, this, rctxt,
                                     tagJarResource);
}
 
示例6
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 (isValidateXml()) {
        context.setInitParameter(Constants.XML_VALIDATION_INIT_PARAM, "true");
    }
    context.setInitParameter(Constants.XML_BLOCK_EXTERNAL_INIT_PARAM,
            String.valueOf(isBlockExternal()));

    tldLocationsCache = TldLocationsCache.getInstance(context);
    rctxt = new JspRuntimeContext(context, this);
    jspConfig = new JspConfig(context);
    tagPluginManager = new TagPluginManager(context);
}
 
示例7
public JspServletWrapper(ServletContext servletContext,
		     Options options,
		     String tagFilePath,
		     TagInfo tagInfo,
		     JspRuntimeContext rctxt,
		     URL tagFileJarUrl)
    throws JasperException {

this.isTagFile = true;
       this.config = null;	// not used
       this.options = options;
this.jspUri = tagFilePath;
this.tripCount = 0;
       ctxt = new JspCompilationContext(jspUri, tagInfo, options,
				 servletContext, this, rctxt,
				 tagFileJarUrl);
   }
 
示例8
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);
}
 
示例9
public JspServletWrapper(ServletConfig config, Options options,
        String jspUri, JspRuntimeContext rctxt) {

    this.isTagFile = false;
    this.config = config;
    this.options = options;
    this.jspUri = jspUri;
    unloadByCount = options.getMaxLoadedJsps() > 0 ? true : false;
    unloadByIdle = options.getJspIdleTimeout() > 0 ? true : false;
    unloadAllowed = unloadByCount || unloadByIdle ? true : false;
    ctxt = new JspCompilationContext(jspUri, options,
                                     config.getServletContext(),
                                     this, rctxt);
}
 
示例10
private JspCompilationContext(String jspUri, TagInfo tagInfo,
        Options options, ServletContext context, JspServletWrapper jsw,
        JspRuntimeContext rctxt, Jar tagJar, boolean isTagFile) {

    this.jspUri = canonicalURI(jspUri);
    this.options = options;
    this.jsw = jsw;
    this.context = context;

    String baseURI = jspUri.substring(0, jspUri.lastIndexOf('/') + 1);
    // hack fix for resolveRelativeURI
    if (baseURI.isEmpty()) {
        baseURI = "/";
    } else if (baseURI.charAt(0) != '/') {
        // strip the base slash since it will be combined with the
        // uriBase to generate a file
        baseURI = "/" + baseURI;
    }
    if (baseURI.charAt(baseURI.length() - 1) != '/') {
        baseURI += '/';
    }
    this.baseURI = baseURI;

    this.rctxt = rctxt;
    this.basePackageName = Constants.JSP_PACKAGE_NAME;

    this.tagInfo = tagInfo;
    this.tagJar = tagJar;
    this.isTagFile = isTagFile;
}
 
示例11
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);
}
 
示例12
public JspServletWrapper(ServletConfig config, Options options,
        String jspUri, JspRuntimeContext rctxt) {

    this.isTagFile = false;
    this.config = config;
    this.options = options;
    this.jspUri = jspUri;
    unloadByCount = options.getMaxLoadedJsps() > 0 ? true : false;
    unloadByIdle = options.getJspIdleTimeout() > 0 ? true : false;
    unloadAllowed = unloadByCount || unloadByIdle ? true : false;
    ctxt = new JspCompilationContext(jspUri, options,
                                     config.getServletContext(),
                                     this, rctxt);
}
 
示例13
public JspCompilationContext(String jspUri,
                             Options options,
                             ServletContext context,
                             JspServletWrapper jsw,
                             JspRuntimeContext rctxt) {

    this.jspUri = canonicalURI(jspUri);
    this.options = options;
    this.jsw = jsw;
    this.context = context;

    this.baseURI = jspUri.substring(0, jspUri.lastIndexOf('/') + 1);
    // hack fix for resolveRelativeURI
    if (baseURI == null) {
        baseURI = "/";
    } else if (baseURI.charAt(0) != '/') {
        // strip the base slash since it will be combined with the
        // uriBase to generate a file
        baseURI = "/" + baseURI;
    }
    if (baseURI.charAt(baseURI.length() - 1) != '/') {
        baseURI += '/';
    }

    this.rctxt = rctxt;
    this.tagFileJarUrls = new HashMap<String, JarResource>();
    this.basePackageName = Constants.JSP_PACKAGE_NAME;
}
 
示例14
public JspCompilationContext(String tagfile,
                             TagInfo tagInfo,
                             Options options,
                             ServletContext context,
                             JspServletWrapper jsw,
                             JspRuntimeContext rctxt,
                             JarResource tagJarResource) {
    this(tagfile, options, context, jsw, rctxt);
    this.isTagFile = true;
    this.tagInfo = tagInfo;
    this.tagJarResource = tagJarResource;
}
 
示例15
public JspServletWrapper(ServletConfig config, Options options,
        String jspUri, JspRuntimeContext rctxt) {

    this.isTagFile = false;
    this.config = config;
    this.options = options;
    this.jspUri = jspUri;
    unloadByCount = options.getMaxLoadedJsps() > 0 ? true : false;
    unloadByIdle = options.getJspIdleTimeout() > 0 ? true : false;
    unloadAllowed = unloadByCount || unloadByIdle ? true : false;
    ctxt = new JspCompilationContext(jspUri, options,
                                     config.getServletContext(),
                                     this, rctxt);
}
 
示例16
public JspCompilationContext(String jspUri,
                             Options options,
                             ServletContext context,
                             JspServletWrapper jsw,
                             JspRuntimeContext rctxt) {

    this.jspUri = canonicalURI(jspUri);
    this.options = options;
    this.jsw = jsw;
    this.context = context;

    this.baseURI = jspUri.substring(0, jspUri.lastIndexOf('/') + 1);
    // hack fix for resolveRelativeURI
    if (baseURI.isEmpty()) {
        baseURI = "/";
    } else if (baseURI.charAt(0) != '/') {
        // strip the base slash since it will be combined with the
        // uriBase to generate a file
        baseURI = "/" + baseURI;
    }
    if (baseURI.charAt(baseURI.length() - 1) != '/') {
        baseURI += '/';
    }

    this.rctxt = rctxt;
    this.tagFileJarUrls = new HashMap<String, JarResource>();
    this.basePackageName = Constants.JSP_PACKAGE_NAME;
}
 
示例17
public JspCompilationContext(String tagfile,
                             TagInfo tagInfo,
                             Options options,
                             ServletContext context,
                             JspServletWrapper jsw,
                             JspRuntimeContext rctxt,
                             JarResource tagJarResource) {
    this(tagfile, options, context, jsw, rctxt);
    this.isTagFile = true;
    this.tagInfo = tagInfo;
    this.tagJarResource = tagJarResource;
}
 
示例18
public JspCompilationContext(String jspUri,
                             boolean isErrPage,
                             Options options,
                             ServletContext context,
                             JspServletWrapper jsw,
                             JspRuntimeContext rctxt)
        throws JasperException {

    this.jspUri = canonicalURI(jspUri);
    this.isErrPage = isErrPage;
    this.options = options;
    this.jsw = jsw;
    this.context = context;

    this.baseURI = jspUri.substring(0, jspUri.lastIndexOf('/') + 1);
    // hack fix for resolveRelativeURI
    if (baseURI == null) {
        baseURI = "/";
    } else if (baseURI.charAt(0) != '/') {
        // strip the basde slash since it will be combined with the
        // uriBase to generate a file
        baseURI = "/" + baseURI;
    }
    if (baseURI.charAt(baseURI.length() - 1) != '/') {
        baseURI += '/';
    }

    this.rctxt = rctxt;
    this.basePackageName = Constants.JSP_PACKAGE_NAME;

    taglibs = cast(context.getAttribute(Constants.JSP_TAGLIBRARY_CACHE));
    tagFileJarUrls = cast(context.getAttribute(Constants.JSP_TAGFILE_JAR_URLS_CACHE));
}
 
示例19
public JspCompilationContext(String tagfile,
                             TagInfo tagInfo, 
                             Options options,
                             ServletContext context,
                             JspServletWrapper jsw,
                             JspRuntimeContext rctxt,
                             URL tagFileJarUrl)
        throws JasperException {
    this(tagfile, false, options, context, jsw, rctxt);
    this.isTagFile = true;
    this.tagInfo = tagInfo;
    this.tagFileJarUrl = tagFileJarUrl;
}
 
示例20
public JspCompilationContext(String jspUri, Options options,
        ServletContext context, JspServletWrapper jsw,
        JspRuntimeContext rctxt) {
    this(jspUri, null, options, context, jsw, rctxt, null, false);
}
 
示例21
public JspCompilationContext(String tagfile, TagInfo tagInfo,
        Options options, ServletContext context, JspServletWrapper jsw,
        JspRuntimeContext rctxt, Jar tagJar) {
    this(tagfile, tagInfo, options, context, jsw, rctxt, tagJar, true);
}
 
示例22
public JspRuntimeContext getRuntimeContext() {
    return rctxt;
}
 
示例23
public JspRuntimeContext getRuntimeContext() {
    return rctxt;
}
 
示例24
public JspRuntimeContext getRuntimeContext() {
    return rctxt;
}
 
示例25
public void init(ServletConfig config) throws ServletException {

        super.init(config);
        this.config = config;
        this.context = config.getServletContext();

        // Initialize the JSP Runtime Context
        options = new EmbeddedServletOptions(config, context);
        rctxt = new JspRuntimeContext(context,options);

        // START SJSWS 6232180
        // Determine which HTTP methods to service ("*" means all)
        httpMethodsString = config.getInitParameter("httpMethods");
        if (httpMethodsString != null
                && !httpMethodsString.equals("*")) {
            httpMethodsSet = new HashSet<String>();
            StringTokenizer tokenizer = new StringTokenizer(
                    httpMethodsString, ", \t\n\r\f");
            while (tokenizer.hasMoreTokens()) {
                httpMethodsSet.add(tokenizer.nextToken());
            }
        }
        // END SJSWS 6232180

        // 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

        if (log.isLoggable(Level.FINEST)) {
            log.finest(Localizer.getMessage("jsp.message.scratch.dir.is",
                                           options.getScratchDir().toString()));
            log.finest(Localizer.getMessage("jsp.message.dont.modify.servlets"));
        }

        this.jspProbeEmitter = (JspProbeEmitter)
            config.getServletContext().getAttribute(
                "org.glassfish.jsp.monitor.probeEmitter");
    }
 
示例26
public JspRuntimeContext getRuntimeContext() {
    return rctxt;
}