si.setLoadOnStartup(wrapper.getLoadOnStartup()); si.setRunAs(wrapper.getRunAs()); si.getMappings().addAll(Arrays.asList(wrapper.findMappings())); if (wrapper instanceof StandardWrapper) { StandardWrapper sw = (StandardWrapper) wrapper;
private void prepareWrapperMappingInfo(Context context, Wrapper wrapper, List<WrapperMappingInfo> wrappers) { String wrapperName = wrapper.getName(); boolean resourceOnly = context.isResourceOnlyServlet(wrapperName); String[] mappings = wrapper.findMappings(); for (String mapping : mappings) { boolean jspWildCard = (wrapperName.equals("jsp") && mapping.endsWith("/*")); wrappers.add(new WrapperMappingInfo(mapping, wrapper, jspWildCard, resourceOnly)); } }
private void prepareWrapperMappingInfo(Context context, Wrapper wrapper, List<WrapperMappingInfo> wrappers) { String wrapperName = wrapper.getName(); boolean resourceOnly = context.isResourceOnlyServlet(wrapperName); String[] mappings = wrapper.findMappings(); for (String mapping : mappings) { boolean jspWildCard = (wrapperName.equals("jsp") && mapping.endsWith("/*")); wrappers.add(new WrapperMappingInfo(mapping, wrapper, jspWildCard, resourceOnly)); } }
accept = false; if (!"org.apache.catalina.servlets.DefaultServlet".equals(wrapper.getServletClass())) { for (final String mapping : wrapper.findMappings()) { if (!mapping.isEmpty() && !"/*".equals(mapping) && !"/".equals(mapping) && !mapping.startsWith("*") && mapping.startsWith(this.mapping)) {
/** * Jacc Specification : Appendix * B.19 Calling isUserInRole from JSP not mapped to a Servlet * Checking a WebRoleRefPermission requires the name of a Servlet to * identify the scope of the reference to role translation. The name of a * scoping servlet has not been established for an unmapped JSP. * * Resolution- For every security role in the web application add a * WebRoleRefPermission to the corresponding role. The name of all such * permissions shall be the empty string, and the actions of each * permission shall be the corresponding role name. * When checking a WebRoleRefPermission from a JSP not mapped to a servlet, * use a permission with the empty string as its name and with the argument to is * UserInRole as its actions. * * @param servlet Wrapper * @return empty string if it is for an unmapped jsp or name of the servlet for others */ private String getServletName(Wrapper servlet) { //For jsp, the mapping will be (*.jsp, *.jspx) String[] mappings = servlet.findMappings(); if (trace) log.trace("[getServletName:servletmappings=" + mappings + ":servlet.getName()=" + servlet.getName() + "]"); if ("jsp".equals(servlet.getName()) && (mappings != null && mappings[0].indexOf("*.jsp") > -1)) return ""; else return servlet.getName(); }
/** * Register wrapper. */ private void registerWrapper(Wrapper wrapper) { String wrapperName = wrapper.getName(); Context context = (Context) wrapper.getParent(); String contextPath = context.getPath(); if ("/".equals(contextPath)) { contextPath = ""; } String version = ((Context) wrapper.getParent()).getWebappVersion(); String hostName = context.getParent().getName(); String[] mappings = wrapper.findMappings(); for (String mapping : mappings) { boolean jspWildCard = (wrapperName.equals("jsp") && mapping.endsWith("/*")); mapper.addWrapper(hostName, contextPath, version, mapping, wrapper, jspWildCard, context.isResourceOnlyServlet(wrapperName)); } if(log.isDebugEnabled()) { log.debug(sm.getString("mapperListener.registerWrapper", wrapperName, contextPath, service)); } }
/** * Register wrapper. */ private void registerWrapper(Wrapper wrapper) { String wrapperName = wrapper.getName(); Context context = (Context) wrapper.getParent(); String contextPath = context.getPath(); if ("/".equals(contextPath)) { contextPath = ""; } String version = ((Context) wrapper.getParent()).getWebappVersion(); String hostName = context.getParent().getName(); String[] mappings = wrapper.findMappings(); for (String mapping : mappings) { boolean jspWildCard = (wrapperName.equals("jsp") && mapping.endsWith("/*")); mapper.addWrapper(hostName, contextPath, version, mapping, wrapper, jspWildCard, context.isResourceOnlyServlet(wrapperName)); } if(log.isDebugEnabled()) { log.debug(sm.getString("mapperListener.registerWrapper", wrapperName, contextPath, connector)); } }
/** * Register wrapper. */ private void registerWrapper(Wrapper wrapper) { String wrapperName = wrapper.getName(); Context context = (Context) wrapper.getParent(); String contextPath = context.getPath(); if ("/".equals(contextPath)) { contextPath = ""; } String version = ((Context) wrapper.getParent()).getWebappVersion(); String hostName = context.getParent().getName(); String[] mappings = wrapper.findMappings(); for (String mapping : mappings) { boolean jspWildCard = (wrapperName.equals("jsp") && mapping.endsWith("/*")); mapper.addWrapper(hostName, contextPath, version, mapping, wrapper, jspWildCard, context.isResourceOnlyServlet(wrapperName)); } if(log.isDebugEnabled()) { log.debug(sm.getString("mapperListener.registerWrapper", wrapperName, contextPath, connector)); } }
/** * Register wrapper. */ private void registerWrapper(Wrapper wrapper) { String wrapperName = wrapper.getName(); Context context = (Context) wrapper.getParent(); String contextPath = context.getPath(); if ("/".equals(contextPath)) { contextPath = ""; } String version = ((Context) wrapper.getParent()).getWebappVersion(); String hostName = context.getParent().getName(); String[] mappings = wrapper.findMappings(); for (String mapping : mappings) { boolean jspWildCard = (wrapperName.equals("jsp") && mapping.endsWith("/*")); mapper.addWrapper(hostName, contextPath, version, mapping, wrapper, jspWildCard, context.isResourceOnlyServlet(wrapperName)); } if(log.isDebugEnabled()) { log.debug(sm.getString("mapperListener.registerWrapper", wrapperName, contextPath, connector)); } }
protected void addContext(Context context) { mapper.addContext(context.getParent().getName(), context.getName(), context, context.findWelcomeFiles(), context.getResources()); // Add all wrappers for (Container child : context.findChildren()) { Wrapper wrapper = (Wrapper) child; if (wrapper.getEnabled()) { for (String mapping : wrapper.findMappings()) { boolean jspWildCard = ("jsp".equals(wrapper.getName()) && mapping.endsWith("/*")); mapper.addWrapper(context.getParent().getName(), context.getName(), mapping, wrapper, jspWildCard); } } } }
/** * Register wrapper. */ private void registerWrapper(Wrapper wrapper) { String wrapperName = wrapper.getName(); Context context = (Context) wrapper.getParent(); String contextPath = context.getPath(); if ("/".equals(contextPath)) { contextPath = ""; } String version = ((Context) wrapper.getParent()).getWebappVersion(); String hostName = context.getParent().getName(); String[] mappings = wrapper.findMappings(); for (String mapping : mappings) { boolean jspWildCard = (wrapperName.equals("jsp") && mapping.endsWith("/*")); mapper.addWrapper(hostName, contextPath, version, mapping, wrapper, jspWildCard, context.isResourceOnlyServlet(wrapperName)); } if(log.isDebugEnabled()) { log.debug(sm.getString("mapperListener.registerWrapper", wrapperName, contextPath, connector)); } }
protected void addContext(Context context) { mapper.addContext(context.getParent().getName(), context.getName(), context, context.findWelcomeFiles(), context.getResources()); // Add all wrappers for (Container child : context.findChildren()) { Wrapper wrapper = (Wrapper) child; if (wrapper.getEnabled()) { for (String mapping : wrapper.findMappings()) { boolean jspWildCard = ("jsp".equals(wrapper.getName()) && mapping.endsWith("/*")); mapper.addWrapper(context.getParent().getName(), context.getName(), mapping, wrapper, jspWildCard); } } } }
/** * Unregister wrapper. */ private void unregisterWrapper(Wrapper wrapper) { Context context = ((Context) wrapper.getParent()); String contextPath = context.getPath(); String wrapperName = wrapper.getName(); if ("/".equals(contextPath)) { contextPath = ""; } String version = context.getWebappVersion(); String hostName = context.getParent().getName(); String[] mappings = wrapper.findMappings(); for (String mapping : mappings) { mapper.removeWrapper(hostName, contextPath, version, mapping); } if(log.isDebugEnabled()) { log.debug(sm.getString("mapperListener.unregisterWrapper", wrapperName, contextPath, service)); } }
/** * Unregister wrapper. */ private void unregisterWrapper(Wrapper wrapper) { Context context = ((Context) wrapper.getParent()); String contextPath = context.getPath(); String wrapperName = wrapper.getName(); if ("/".equals(contextPath)) { contextPath = ""; } String version = context.getWebappVersion(); String hostName = context.getParent().getName(); String[] mappings = wrapper.findMappings(); for (String mapping : mappings) { mapper.removeWrapper(hostName, contextPath, version, mapping); } if(log.isDebugEnabled()) { log.debug(sm.getString("mapperListener.unregisterWrapper", wrapperName, contextPath, service)); } }
/** * Unregister wrapper. */ private void unregisterWrapper(Wrapper wrapper) { String contextPath = ((Context) wrapper.getParent()).getPath(); String wrapperName = wrapper.getName(); if ("/".equals(contextPath)) { contextPath = ""; } String version = ((Context) wrapper.getParent()).getWebappVersion(); String hostName = wrapper.getParent().getParent().getName(); String[] mappings = wrapper.findMappings(); for (String mapping : mappings) { mapper.removeWrapper(hostName, contextPath, version, mapping); } if(log.isDebugEnabled()) { log.debug(sm.getString("mapperListener.unregisterWrapper", wrapperName, contextPath, connector)); } }
/** * Unregister wrapper. */ private void unregisterWrapper(Wrapper wrapper) { String contextPath = ((Context) wrapper.getParent()).getPath(); String wrapperName = wrapper.getName(); if ("/".equals(contextPath)) { contextPath = ""; } String version = ((Context) wrapper.getParent()).getWebappVersion(); String hostName = wrapper.getParent().getParent().getName(); String[] mappings = wrapper.findMappings(); for (String mapping : mappings) { mapper.removeWrapper(hostName, contextPath, version, mapping); } if(log.isDebugEnabled()) { log.debug(sm.getString("mapperListener.unregisterWrapper", wrapperName, contextPath, connector)); } }
/** * Unregister wrapper. */ private void unregisterWrapper(Wrapper wrapper) { String contextPath = ((Context) wrapper.getParent()).getPath(); String wrapperName = wrapper.getName(); if ("/".equals(contextPath)) { contextPath = ""; } String version = ((Context) wrapper.getParent()).getWebappVersion(); String hostName = wrapper.getParent().getParent().getName(); String[] mappings = wrapper.findMappings(); for (String mapping : mappings) { mapper.removeWrapper(hostName, contextPath, version, mapping); } if(log.isDebugEnabled()) { log.debug(sm.getString("mapperListener.unregisterWrapper", wrapperName, contextPath, connector)); } }
/** * Unregister wrapper. */ private void unregisterWrapper(Wrapper wrapper) { String contextPath = ((Context) wrapper.getParent()).getPath(); String wrapperName = wrapper.getName(); if ("/".equals(contextPath)) { contextPath = ""; } String version = ((Context) wrapper.getParent()).getWebappVersion(); String hostName = wrapper.getParent().getParent().getName(); String[] mappings = wrapper.findMappings(); for (String mapping : mappings) { mapper.removeWrapper(hostName, contextPath, version, mapping); } if(log.isDebugEnabled()) { log.debug(sm.getString("mapperListener.unregisterWrapper", wrapperName, contextPath, connector)); } }
/** * Unregister wrapper. */ private void unregisterWrapper(Wrapper wrapper) { String contextPath = ((Context) wrapper.getParent()).getPath(); String wrapperName = wrapper.getName(); if ("/".equals(contextPath)) { contextPath = ""; } String version = ((Context) wrapper.getParent()).getWebappVersion(); String hostName = wrapper.getParent().getParent().getName(); String[] mappings = wrapper.findMappings(); for (String mapping : mappings) { mapper.removeWrapper(hostName, contextPath, version, mapping); } if(log.isDebugEnabled()) { log.debug(sm.getString("mapperListener.unregisterWrapper", wrapperName, contextPath, service)); } }
/** * Unregister wrapper. */ private void unregisterWrapper(Wrapper wrapper) { String contextPath = ((Context) wrapper.getParent()).getPath(); String wrapperName = wrapper.getName(); if ("/".equals(contextPath)) { contextPath = ""; } String version = ((Context) wrapper.getParent()).getWebappVersion(); String hostName = wrapper.getParent().getParent().getName(); String[] mappings = wrapper.findMappings(); for (String mapping : mappings) { mapper.removeWrapper(hostName, contextPath, version, mapping); } if(log.isDebugEnabled()) { log.debug(sm.getString("mapperListener.unregisterWrapper", wrapperName, contextPath, connector)); } }