@Override public ELContextImpl createELContext(JspContext arg0) { return delegate.createELContext(arg0); }
@Override public ExpressionFactory getExpressionFactory() { if (factory == null) { synchronized (this) { if (factory == null) { factory = delegate.getExpressionFactory(); for (ExpressionFactoryWrapper wrapper : wrapperList) { factory = wrapper.wrap(factory, servletContext); } } } } return factory; }
@Override public void contextInitialized(final ServletContextEvent sce) { // if the servlet version is 3.1 or higher, setup a ELResolver which allows usage of static fields java.lang.* final ServletContext servletContext = sce.getServletContext(); final JspApplicationContext jspApplicationContext = JspFactory.getDefaultFactory().getJspApplicationContext(servletContext); if (servletContext.getEffectiveMajorVersion() > 3 || (servletContext.getEffectiveMajorVersion() == 3 && servletContext.getEffectiveMinorVersion() >= 1)) { jspApplicationContext.addELResolver(new ImportedClassELResolver()); } // setup a wrapped JspApplicationContext if there are any EL expression factory wrappers for this servlet context final List<ExpressionFactoryWrapper> expressionFactoryWrappers = (List<ExpressionFactoryWrapper>) sce.getServletContext().getAttribute(CONTEXT_KEY); if (expressionFactoryWrappers != null && !expressionFactoryWrappers.isEmpty()) { final JspApplicationContextWrapper jspApplicationContextWrapper = new JspApplicationContextWrapper(JspApplicationContextImpl.getInstance(servletContext), expressionFactoryWrappers, sce.getServletContext()); sce.getServletContext().setAttribute(JspApplicationContextImpl.class.getName(), jspApplicationContextWrapper); } }
protected static JspApplicationContextImpl findJspApplicationContext(ServletContext context) { JspApplicationContextImpl jaContext = map.get(context); if (jaContext == null) { jaContext = new JspApplicationContextImpl(context); map.put(context, jaContext); } return jaContext; }
/** * Configures this implementation for EL support. * Use * <code>getWebMockObjectFactory().setDefaultJspFactory(new JasperJspFactory().configure(getWebMockObjectFactory()));</code> * to set this implementation as the default factory. * @return this instance for convenience */ public JasperJspFactory configure(WebMockObjectFactory mockFactory) { this.mockFactory = mockFactory; applicationContext = JspApplicationContextImpl.getInstance(mockFactory.getMockServletContext()); mockFactory.getMockPageContext().setELContext(applicationContext.createELContext(mockFactory.getMockPageContext())); return this; }
JspApplicationContextImpl getJspApplicationContext() { if (jspApplicationContext == null) { jspApplicationContext = JspApplicationContextImpl.findJspApplicationContext(context); } return jspApplicationContext; }
public void destroy() { if (log.isLoggable(Level.FINE)) { log.fine("JspServlet.destroy()"); } rctxt.destroy(); JspApplicationContextImpl.removeJspApplicationContext(context); // START GlassFish 750 taglibs.clear(); tagFileJarUrls.clear(); // END GlassFish 750 // START GlassFish 747 HashMap tldUriToLocationMap = (HashMap) context.getAttribute( Constants.JSP_TLD_URI_TO_LOCATION_MAP); if (tldUriToLocationMap != null) { tldUriToLocationMap.clear(); } // END GlassFish 747 }
private ELResolver getELResolver() { if (elResolver == null) { // Create a CompositeELResolver CompositeELResolver celResolver = new CompositeELResolver(); celResolver.add(new ImplicitObjectELResolver()); // Add ELResolvers registered in JspApplicationContext JspApplicationContextImpl jaContext = getJspApplicationContext(); Iterator<ELResolver> it = jaContext.getELResolvers(); while (it.hasNext()) { celResolver.add(it.next()); } celResolver.add(new MapELResolver()); celResolver.add(new ResourceBundleELResolver()); celResolver.add(new ListELResolver()); celResolver.add(new ArrayELResolver()); celResolver.add(new BeanELResolver()); celResolver.add(new ScopedAttributeELResolver()); elResolver = celResolver; } return elResolver; }
public ELContextImpl createELContext(JspContext context) { if (context == null) { throw new IllegalArgumentException("JspContext was null"); } // create ELContext for JspContext final ELResolver r = this.createELResolver(); ELContextImpl ctx; if (Constants.IS_SECURITY_ENABLED) { ctx = AccessController.doPrivileged( new PrivilegedAction<ELContextImpl>() { @Override public ELContextImpl run() { return new ELContextImpl(r); } }); } else { ctx = new ELContextImpl(r); } ctx.putContext(JspContext.class, context); // alert all ELContextListeners ELContextEvent event = new ELContextEvent(ctx); for (int i = 0; i < this.contextListeners.size(); i++) { this.contextListeners.get(i).contextCreated(event); } return ctx; }
public ELContextImpl createELContext(JspContext context) { if (context == null) { throw new IllegalArgumentException("JspContext was null"); } // create ELContext for JspContext final ELResolver r = this.createELResolver(); ELContextImpl ctx; if (Constants.IS_SECURITY_ENABLED) { ctx = AccessController.doPrivileged( new PrivilegedAction<ELContextImpl>() { @Override public ELContextImpl run() { return new ELContextImpl(r); } }); } else { ctx = new ELContextImpl(r); } ctx.putContext(JspContext.class, context); // alert all ELContextListeners fireListeners(ctx); return ctx; }
protected static JspApplicationContextImpl findJspApplicationContext(ServletContext context) { JspApplicationContextImpl jaContext = map.get(context); if (jaContext == null) { jaContext = new JspApplicationContextImpl(context); map.put(context, jaContext); } return jaContext; }
JspApplicationContextImpl getJspApplicationContext() { if (jspApplicationContext == null) { jspApplicationContext = JspApplicationContextImpl.findJspApplicationContext(context); } return jspApplicationContext; }
public void destroy() { if (log.isLoggable(Level.FINE)) { log.fine("JspServlet.destroy()"); } rctxt.destroy(); JspApplicationContextImpl.removeJspApplicationContext(context); // START GlassFish 750 taglibs.clear(); tagFileJarUrls.clear(); // END GlassFish 750 // START GlassFish 747 HashMap tldUriToLocationMap = (HashMap) context.getAttribute( Constants.JSP_TLD_URI_TO_LOCATION_MAP); if (tldUriToLocationMap != null) { tldUriToLocationMap.clear(); } // END GlassFish 747 }
private ELResolver getELResolver() { if (elResolver == null) { // Create a CompositeELResolver CompositeELResolver celResolver = new CompositeELResolver(); celResolver.add(new ImplicitObjectELResolver()); // Add ELResolvers registered in JspApplicationContext JspApplicationContextImpl jaContext = getJspApplicationContext(); Iterator<ELResolver> it = jaContext.getELResolvers(); while (it.hasNext()) { celResolver.add(it.next()); } celResolver.add(new MapELResolver()); celResolver.add(new ResourceBundleELResolver()); celResolver.add(new ListELResolver()); celResolver.add(new ArrayELResolver()); celResolver.add(new BeanELResolver()); celResolver.add(new ScopedAttributeELResolver()); elResolver = celResolver; } return elResolver; }
public ELContextImpl createELContext(JspContext context) { if (context == null) { throw new IllegalArgumentException("JspContext was null"); } // create ELContext for JspContext final ELResolver r = this.createELResolver(); ELContextImpl ctx; if (Constants.IS_SECURITY_ENABLED) { ctx = AccessController.doPrivileged( new PrivilegedAction<ELContextImpl>() { public ELContextImpl run() { return new ELContextImpl(r); } }); } else { ctx = new ELContextImpl(r); } ctx.putContext(JspContext.class, context); // alert all ELContextListeners ELContextEvent event = new ELContextEvent(ctx); for (int i = 0; i < this.contextListeners.size(); i++) { this.contextListeners.get(i).contextCreated(event); } return ctx; }
public ELContext getELContext() { if (this.elContext == null) { this.elContext = this.applicationContext.createELContext(this); } return this.elContext; }
/** * Provides programmatic access to the ExpressionEvaluator. The JSP * Container must return a valid instance of an ExpressionEvaluator that can * parse EL expressions. */ @Override @Deprecated public javax.servlet.jsp.el.ExpressionEvaluator getExpressionEvaluator() { return new org.apache.jasper.el.ExpressionEvaluatorImpl( this.applicationContext.getExpressionFactory()); }
protected static JspApplicationContextImpl findJspApplicationContext(ServletContext context) { JspApplicationContextImpl jaContext = map.get(context); if (jaContext == null) { jaContext = new JspApplicationContextImpl(context); map.put(context, jaContext); } return jaContext; }
@Override public JspApplicationContext run() { return JspApplicationContextImpl.getInstance(context); } });
JspApplicationContextImpl getJspApplicationContext() { if (jspApplicationContext == null) { jspApplicationContext = JspApplicationContextImpl.findJspApplicationContext(context); } return jspApplicationContext; }