Package org.apache.geronimo.web.info

Examples of org.apache.geronimo.web.info.ServletInfo


    protected static final String POLICY_CONTEXT_ID = "securetest";
    protected GenericSecurityRealm realm;
    private Bundle bundle;

    protected void setUpStaticContentServlet(WebAppInfo webAppInfo) throws Exception {
        ServletInfo servletInfo = new ServletInfo();
        servletInfo.servletName = "default";
        servletInfo.servletClass = "org.apache.catalina.servlets.DefaultServlet";
        servletInfo.servletMappings.add("/");
        servletInfo.initParams.put("acceptRanges", "true");
        webAppInfo.servlets.add(servletInfo);
View Full Code Here


    protected String appPath;
    protected int connectorPort = 1234;
    protected String hostURL = "http://localhost:" + connectorPort;

    protected void setUpStaticContentServlet(WebAppInfo webAppInfo) throws Exception {
        ServletInfo servletInfo = new ServletInfo();
        servletInfo.servletName = "default";
        servletInfo.servletClass = "org.eclipse.jetty.servlet.DefaultServlet";
        servletInfo.servletMappings.add("/");
        servletInfo.initParams.put("acceptRanges", "true");
        servletInfo.initParams.put("dirAllowed", "true");
View Full Code Here

*/
public class BasicTest extends TestCase {
   
    public void testJspModuleBuilderExtension() throws Exception {
        WebAppInfo webAppInfo = new WebAppInfo();
        webAppInfo.servlets.add(new ServletInfo());
        JspModuleBuilderExtension instance = new JspModuleBuilderExtension(null, null, webAppInfo, new NamingBuilderCollection(Collections.EMPTY_SET));
    }
View Full Code Here

        WebAppInfoBuilder webAppInfoBuilder = (WebAppInfoBuilder)sharedContext.get(WebModule.WEB_APP_INFO);
        if (webAppInfoBuilder != null) {
            WebAppInfo webAppInfo = webAppInfoBuilder.getWebAppInfo();
            webAppInfo.listeners.addAll(listenerNames);
            //install default jsp servlet....
            ServletInfo jspServlet = webAppInfoBuilder.copy(defaultJspServletInfo);
            List<JspConfig> jspConfigs = webApp.getJspConfig();
            List<String> jspMappings = new ArrayList<String>();
            for (JspConfig jspConfig : jspConfigs) {
                for (JspPropertyGroup propertyGroup : jspConfig.getJspPropertyGroup()) {
                    WebAppInfoBuilder.normalizeUrlPatterns(propertyGroup.getUrlPattern(), jspMappings);
View Full Code Here

        return true;
    }

    @Override
    public ServletInfo newJspInfo(String jspFile) {
        ServletInfo servletInfo = copy(jspServletInfo);
        servletInfo.initParams.put("jspFile", jspFile);
        return servletInfo;
    }
View Full Code Here

            webAppInfo.securityRoles.add(securityRole.getRoleName().trim());
        }

        Map<String, ServletInfo> servletMap = new HashMap<String, ServletInfo>();
        for (Servlet servlet : webApp.getServlet()) {
            ServletInfo servletInfo;
            if (servlet.getServletClass() != null) {
                servletInfo = webAppInfoFactory.newServletInfo();
                servletInfo.servletClass = servlet.getServletClass();
            } else if (servlet.getJspFile() != null) {
                servletInfo = webAppInfoFactory.newJspInfo(servlet.getJspFile());
            } else {
                problems.add("\nNo servlet class or jsp file for servlet " + servlet.getServletName());
                continue;
            }
            servletInfo.servletName = servlet.getServletName();
            if (servlet.getAsyncSupported() != null) {
                servletInfo.asyncSupported = servlet.getAsyncSupported();
            }
            servletInfo.loadOnStartup = servlet.getLoadOnStartup();
            if (servlet.getRunAs() != null) {
                servletInfo.runAsRole = servlet.getRunAs().getRoleName().trim();
            }
            if (servlet.getMultipartConfig() != null) {
                MultipartConfig multipartConfig = servlet.getMultipartConfig();
                MultipartConfigInfo multipartConfigInfo = new MultipartConfigInfo();
                multipartConfigInfo.location = multipartConfig.getLocation();
                multipartConfigInfo.maxFileSize = multipartConfig.getMaxFileSize();
                multipartConfigInfo.maxRequestSize = multipartConfig.getMaxRequestSize();
                multipartConfigInfo.fileSizeThreshold = multipartConfig.getFileSizeThreshold();
                servletInfo.multipartConfigInfo = multipartConfigInfo;
            }
            addParams(servlet.getInitParam(), servletInfo.initParams);
            for (SecurityRoleRef securityRoleRef : servlet.getSecurityRoleRef()) {
                SecurityRoleRefInfo securityRoleRefInfo = new SecurityRoleRefInfo();
                if (securityRoleRef.getRoleLink() != null) {
                    securityRoleRefInfo.roleLink = securityRoleRef.getRoleLink().trim();
                }
                securityRoleRefInfo.roleName = securityRoleRef.getRoleName().trim();
                servletInfo.securityRoleRefs.add(securityRoleRefInfo);
            }
            webAppInfo.servlets.add(servletInfo);
            servletMap.put(servletInfo.servletName, servletInfo);
        }
        for (ServletMapping servletMapping : webApp.getServletMapping()) {
            String servletName = servletMapping.getServletName().trim();
            ServletInfo servletInfo = servletMap.get(servletName);
            if (servletInfo == null) {
                problems.add("\nNo servlet matching servlet mappings for " + servletName);
            } else {
                normalizeUrlPatterns(servletMapping.getUrlPattern(), servletInfo.servletMappings);
            }
View Full Code Here

        return new FilterInfo();
    }

    @Override
    public ServletInfo newServletInfo() {
        return new ServletInfo();
    }
View Full Code Here

        return copy;
    }

    @Override
    public ServletInfo copy(ServletInfo servletInfo) {
         ServletInfo copy = new ServletInfo();
         copy.servletClass = servletInfo.servletClass;
         copy.servletMappings.addAll(servletInfo.servletMappings);
         copy.servletName = servletInfo.servletName;
         copy.asyncSupported = servletInfo.asyncSupported;
         copy.initParams.putAll(servletInfo.initParams);
View Full Code Here

                              @ParamSpecial(type = SpecialAttributeType.bundleContext) BundleContext bundleContext) throws GBeanNotFoundException, DeploymentException {
        super(kernel, serviceBuilders, namingBuilders, resourceEnvironmentSetter, webServiceBuilder, moduleBuilderExtensions, bundleContext);
        this.defaultEnvironment = defaultEnvironment;
        this.defaultSessionTimeoutMinutes = (defaultSessionTimeoutSeconds == null) ? 30 * 60 : defaultSessionTimeoutSeconds;
        this.jettyContainerObjectName = jettyContainerName;
        ServletInfo jspServletInfo;
        if (jspServlet != null) {
            jspServletInfo = jspServlet.servlets.get(0);
        } else {
            jspServletInfo = null;
        }
View Full Code Here

            @ParamSpecial(type = SpecialAttributeType.bundleContext) BundleContext bundleContext) {
        super(kernel, serviceBuilders, namingBuilders, resourceEnvironmentSetter, webServiceBuilder, moduleBuilderExtensions, bundleContext);
        this.defaultEnvironment = defaultEnvironment;
        this.clusteringBuilders = new NamespaceDrivenBuilderCollection(clusteringBuilders);
        this.tomcatContainerName = tomcatContainerName;
        ServletInfo jspServletInfo;
        if (jspServlet != null) {
            jspServletInfo = jspServlet.servlets.get(0);
        } else {
            jspServletInfo = null;
        }
View Full Code Here

TOP

Related Classes of org.apache.geronimo.web.info.ServletInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.