@Override public String getProperty(String name) throws UnknownPropertyError { // Obtain the extension property value return HttpTemplateSectionSource.this.getContext().getProperty(this.extensionPropertyPrefix + name); }
@Override public Properties getProperties() { // Obtain all the properties Properties properties = new Properties(); // Filter to just this extension's properties String[] contextNames = HttpTemplateSectionSource.this.getContext().getPropertyNames(); for (String contextName : contextNames) { if (contextName.startsWith(this.extensionPropertyPrefix)) { // Add the extension property name String extensionName = contextName.substring(this.extensionPropertyPrefix.length()); String value = HttpTemplateSectionSource.this.getContext().getProperty(contextName); properties.setProperty(extensionName, value); } } // Return the properties return properties; }
@Override public void sourceSection(SectionDesigner designer, SectionSourceContext context) throws Exception { // Create the Servlet Bridge dependency SectionObject servletBridge = designer.addSectionObject( "SERVLET_BRIDGE", ServletBridge.class.getName()); // Create the non-handled task String nonHandledInputName = context.getSectionLocation(); this.addServletResource(nonHandledInputName, null, servletBridge, designer); // Create the Servlet container resource tasks Set<String> registeredResources = new HashSet<String>(); for (String inputName : context.getPropertyNames()) { // Obtain the request dispatcher path String requestDispatcherPath = context.getProperty(inputName); // Ensure only register the resource once if (registeredResources.contains(requestDispatcherPath)) { continue; } // Add Servlet Resource this.addServletResource(inputName, requestDispatcherPath, servletBridge, designer); // Resource registered registeredResources.add(requestDispatcherPath); } }
@Override public String getProperty(String name, String defaultValue) { // Obtain the extension property value return HttpTemplateSectionSource.this.getContext().getProperty(this.extensionPropertyPrefix + name, defaultValue); }
String inputName = context.getProperty(propertyName); String isSecureText = context.getProperty( PROPERTY_URL_SECURE_PREFIX + uriPath, null); Boolean isSecure = null;
String webXmlContent = context.getProperty(PROPERTY_WEB_XML_CONFIGURATION); webXmlConfiguration = new ByteArrayInputStream(webXmlContent.getBytes());
String resourcePath = context.getProperty(name);
key = context.getProperty(PROPERTY_HTTP_SECURITY_SOURCE_KEY);
String requestUriPrefix = context.getProperty(name).trim();
String sectionClassName = context.getProperty(PROPERTY_CLASS_NAME, null); boolean isLogicClass = true; if (CompileUtil.isBlank(sectionClassName)) { .parseInt(context.getProperty(PROPERTY_INHERITED_TEMPLATES_COUNT, String.valueOf(0))); String[] templateInheritanceHierarchy = new String[inheritedTemplatesCount + 1]; for (int inheritanceIndex = 0; inheritanceIndex < inheritedTemplatesCount; inheritanceIndex++) { .valueOf(context.getProperty(PROPERTY_TEMPLATE_SECURE, String.valueOf(false))); String templateContentType = context.getProperty(PROPERTY_CONTENT_TYPE, null); String charsetName = context.getProperty(PROPERTY_CHARSET, null); if (!CompileUtil.isBlank(charsetName)) { .getProperty(PROPERTY_LINK_SEPARATOR, String.valueOf(DEFAULT_LINK_SEPARATOR)).charAt(0); .parseBoolean(context.getProperty(PROPERTY_IS_PATH_PARAMETERS, String.valueOf(false))); if (isPathParameters && (!isLogicClass)) { throw designer.addIssue("Must provide logic class, as template has path parameters"); String redirectValuesFunctionName = context.getProperty(PROPERTY_REDIRECT_VALUES_FUNCTION, null); SectionFunction redirectValuesFunction = null; Class<?> redirectValuesType = null;
String sectionClassName = context.getProperty(PROPERTY_CLASS_NAME, null); boolean isLogicClass = true; if (CompileUtil.isBlank(sectionClassName)) { String inheritedTemplatesValue = context.getProperty(PROPERTY_INHERITED_TEMPLATES, null); if (inheritedTemplatesValue != null) { String templateUriPath = context.getProperty(PROPERTY_TEMPLATE_URI); String extensionClassName = context.getProperty(EXTENSION_PREFIX + extensionIndex, null); while (extensionClassName != null) { extensionClassName = context.getProperty(EXTENSION_PREFIX + extensionIndex, null); String templateUriSuffix = context.getProperty(HttpTemplateWorkSource.PROPERTY_TEMPLATE_URI_SUFFIX, null);