public void visitErrorPage(WebAppContext context, Descriptor descriptor, XmlParser.Node node) String error = node.getString("error-code", false, true); int code=0; if (error == null || error.length() == 0) error = node.getString("exception-type", false, true); if (error == null || error.length() == 0) error = ErrorPageErrorHandler.GLOBAL_ERROR_PAGE; code=Integer.parseInt(error); String location = node.getString("location", false, true); if (!location.startsWith("/")) throw new IllegalStateException("Missing leading '/' for location: " + location);
public void visitListener (WebAppContext context, Descriptor descriptor, XmlParser.Node node) { String className=node.getString("listener-class",false,true); if (LOG.isDebugEnabled()) LOG.debug("listener="+className); try { Class<?> listenerClass = context.loadClass(className); EventListener l = (EventListener)listenerClass.newInstance(); _listeners.add(l); } catch(Exception e) { LOG.warn("Could not instantiate listener "+className+": "+e); LOG.debug(e); } catch(Error e) { LOG.warn("Could not instantiate listener "+className+": "+e); LOG.debug(e); } }
public void visitListener (WebAppContext context, Descriptor descriptor, XmlParser.Node node) { String className=node.getString("listener-class",false,true); if (LOG.isDebugEnabled()) LOG.debug("listener="+className); try { Class<?> listenerClass = context.loadClass(className); EventListener l = (EventListener)listenerClass.newInstance(); _listeners.add(l); } catch(Exception e) { LOG.warn("Could not instantiate listener "+className+": "+e); LOG.debug(e); } catch(Error e) { LOG.warn("Could not instantiate listener "+className+": "+e); LOG.debug(e); } }
/** * @param context * @param descriptor * @param node */ protected void visitTagLib(WebAppContext context, Descriptor descriptor, XmlParser.Node node) { //Additive across web.xml and web-fragment.xml String uri = node.getString("taglib-uri", false, true); String location = node.getString("taglib-location", false, true); context.setResourceAlias(uri, location); JspConfig config = (JspConfig)context.getServletContext().getJspConfigDescriptor(); if (config == null) { config = new JspConfig(); context.getServletContext().setJspConfigDescriptor(config); } TagLib tl = new TagLib(); tl.setTaglibLocation(location); tl.setTaglibURI(uri); config.addTaglibDescriptor(tl); }
public void visitListener (WebAppContext context, Descriptor descriptor, XmlParser.Node node) { String className=node.getString("listener-class",false,true); if (LOG.isDebugEnabled()) LOG.debug("listener="+className); try { Class<?> listenerClass = context.loadClass(className); EventListener l = (EventListener)listenerClass.newInstance(); _listeners.add(l); } catch(Exception e) { LOG.warn("Could not instantiate listener "+className+": "+e); LOG.debug(e); } catch(Error e) { LOG.warn("Could not instantiate listener "+className+": "+e); LOG.debug(e); } }
/** * @param context * @param descriptor * @param node */ protected void visitTagLib(WebAppContext context, Descriptor descriptor, XmlParser.Node node) { //Additive across web.xml and web-fragment.xml String uri = node.getString("taglib-uri", false, true); String location = node.getString("taglib-location", false, true); context.setResourceAlias(uri, location); JspConfig config = (JspConfig)context.getServletContext().getJspConfigDescriptor(); if (config == null) { config = new JspConfig(); context.getServletContext().setJspConfigDescriptor(config); } TagLib tl = new TagLib(); tl.setTaglibLocation(location); tl.setTaglibURI(uri); config.addTaglibDescriptor(tl); }
public void visitListener (WebAppContext context, Descriptor descriptor, XmlParser.Node node) { String className=node.getString("listener-class",false,true); if (LOG.isDebugEnabled()) LOG.debug("listener="+className); try { Class<?> listenerClass = context.loadClass(className); EventListener l = (EventListener)listenerClass.newInstance(); _listeners.add(l); } catch(Exception e) { LOG.warn("Could not instantiate listener "+className+": "+e); LOG.debug(e); } catch(Error e) { LOG.warn("Could not instantiate listener "+className+": "+e); LOG.debug(e); } }
public void visitTagLib(WebAppContext context, Descriptor descriptor, XmlParser.Node node) { //Additive across web.xml and web-fragment.xml String uri = node.getString("taglib-uri", false, true); String location = node.getString("taglib-location", false, true); context.setResourceAlias(uri, location); JspConfig config = (JspConfig)context.getServletContext().getJspConfigDescriptor(); if (config == null) { config = new JspConfig(); context.getServletContext().setJspConfigDescriptor(config); } TagLib tl = new TagLib(); tl.setTaglibLocation(location); tl.setTaglibURI(uri); config.addTaglibDescriptor(tl); }
String name = node.getString("servlet-name", false, true); ServletHolder holder = _servletHolderMap.get(name); String pname = paramNode.getString("param-name", false, true); String pvalue = paramNode.getString("param-value", false, true); String originName = name+".servlet.init-param."+pname; String servlet_class = node.getString("servlet-class", false, true); if ("".equals(servlet_class)) servlet_class = null; String jsp_file = node.getString("jsp-file", false, true); if (jsp_file != null) holder.setForcedPath(jsp_file); String roleName = securityRef.getString("role-name", false, true); String roleLink = securityRef.getString("role-link", false, true); if (roleName != null && roleName.length() > 0 && roleLink != null && roleLink.length() > 0) String roleName = run_as.getString("role-name", false, true); String async=node.getString("async-supported",false,true); if (async!=null) String enabled = node.getString("enabled", false, true); if (enabled!=null) String location = multipart.getString("location", false, true); String maxFile = multipart.getString("max-file-size", false, true);
String name = cookieConfig.getString("name", false, true); if (name != null) String domain = cookieConfig.getString("domain", false, true); if (domain != null) String path = cookieConfig.getString("path", false, true); if (path != null) String comment = cookieConfig.getString("comment", false, true); if (comment != null)
public void visitFilter(WebAppContext context, Descriptor descriptor, XmlParser.Node node) String name = node.getString("filter-name", false, true); FilterHolder holder = _filterHolderMap.get(name); if (holder == null) String filter_class = node.getString("filter-class", false, true); if (filter_class != null) String pname = paramNode.getString("param-name", false, true); String pvalue = paramNode.getString("param-value", false, true); String async=node.getString("async-supported",false,true); if (async!=null) holder.setAsyncSupported(async.length()==0||Boolean.parseBoolean(async));
jpg.setElIgnored(group.getString("el-ignored", false, true)); jpg.setPageEncoding(group.getString("page-encoding", false, true)); jpg.setScriptingInvalid(group.getString("scripting-invalid", false, true)); jpg.setIsXml(group.getString("is-xml", false, true)); jpg.setDeferredSyntaxAllowedAsLiteral(group.getString("deferred-syntax-allowed-as-literal", false, true)); jpg.setTrimDirectiveWhitespaces(group.getString("trim-directive-whitespaces", false, true)); jpg.setDefaultContentType(group.getString("default-content-type", false, true)); jpg.setBuffer(group.getString("buffer", false, true)); jpg.setErrorOnUndeclaredNamespace(group.getString("error-on-undeclared-namespace", false, true));
String name = collection.getString("web-resource-name", false, true); Constraint sc = (Constraint) scBase.clone(); sc.setName(name);
public void visitMimeMapping(WebAppContext context, Descriptor descriptor, XmlParser.Node node) String extension = node.getString("extension", false, true); if (extension != null && extension.startsWith(".")) extension = extension.substring(1); String mimeType = node.getString("mime-type", false, true); if (extension != null)
String filter_name = node.getString("filter-name", false, true); switch (context.getMetaData().getOrigin(filter_name+".filter.mappings"))
String servlet_name = node.getString("servlet-name", false, true); switch (context.getMetaData().getOrigin(servlet_name+".servlet.mappings"))
public void visitListener(WebAppContext context, Descriptor descriptor, XmlParser.Node node) { String className = node.getString("listener-class", false, true); EventListener listener = null; try { if (className != null && className.length()> 0) { //Servlet Spec 3.0 p 74 //Duplicate listener declarations don't result in duplicate listener instances for (ListenerHolder holder : context.getServletHandler().getListeners()) { if (holder.getClassName().equals(className)) return; } ((WebDescriptor)descriptor).addClassName(className); ListenerHolder h = context.getServletHandler().newListenerHolder(new Source (Source.Origin.DESCRIPTOR, descriptor.getResource().toString())); h.setClassName(className); context.getServletHandler().addListener(h); context.getMetaData().setOrigin(className+".listener", descriptor); } } catch (Exception e) { LOG.warn("Could not instantiate listener " + className, e); return; } }
public void visitTagLib(WebAppContext context, Descriptor descriptor, XmlParser.Node node) { //Additive across web.xml and web-fragment.xml String uri = node.getString("taglib-uri", false, true); String location = node.getString("taglib-location", false, true); context.setResourceAlias(uri, location); JspConfig config = (JspConfig)context.getServletContext().getJspConfigDescriptor(); if (config == null) { config = new JspConfig(); context.getServletContext().setJspConfigDescriptor(config); } TagLib tl = new TagLib(); tl.setTaglibLocation(location); tl.setTaglibURI(uri); config.addTaglibDescriptor(tl); }