Package com.google.opengse.configuration

Examples of com.google.opengse.configuration.WebAppConfiguration


   */
  public static WebApp createWebApp(File contextBase, String uriPrefix,
      ServletContainerContext containerContext)
      throws WebAppConfigurationException, ClassNotFoundException,
      InstantiationException, IllegalAccessException {
    WebAppConfiguration config = WebAppConfigurationFactory
        .getConfiguration(contextBase);
    File webinfdir = new File(contextBase, "WEB-INF");
    File classesdir = new File(webinfdir, "classes");
    File libdir = new File(webinfdir, "lib");
    List<URL> urlList = new ArrayList<URL>();
View Full Code Here


  public void testParse() throws Exception {
    String testFile = "test1.web.xml";
    byte[] inputBytes = getResourceBytes(testFile);
    InputStream webxmlStream = new ByteArrayInputStream(inputBytes);
    WebAppConfiguration config = parser
        .parse(new InputStreamReader(webxmlStream));
    StringWriter stringWriter = new StringWriter();
    PrintWriter out = new PrintWriter(stringWriter);
    WebXmlDump.dump(config, out);
    out.close();
View Full Code Here

        .parse(new InputStreamReader(webxmlStream1));

  }

  public void testCombine() throws Exception {
    WebAppConfiguration config1 = getConfigFromResource("test1.web.xml");
    WebAppConfiguration config2 = getConfigFromResource("test2.web.xml");

    WebAppConfiguration combinedConfig = WebAppConfigurationCombiner.combine(config1, config2);

    String combinedWebXml = toString(combinedConfig);
    String expectedCombinedWebXml = getResourceAsString("test1_and_test2_combined.xml");
    assertEquals("Did not get expected web.xml", expectedCombinedWebXml, combinedWebXml);
  }
View Full Code Here

  @Override
  public void init() throws ServletException {
    super.init();

    WebAppConfiguration config;
    WebAppWelcomeFileList welcomeFileList;
    String contextdir = this.getServletContext().getRealPath("/");
    try {
      config = WebAppConfigurationFactory.getConfiguration(new File(contextdir));
      welcomeFileList = config.getWelcomeFileList();
    } catch (WebAppConfigurationException e) {
      // Errors on getting configuration from web.xml
      welcomeFileList = null;
    }
    if (welcomeFileList != null) {
View Full Code Here

  public static WebApp create(String uriPrefix, File contextbase,
                              ClassLoader classLoader, WebAppConfiguration localConfig,
                              ServletContainerContext containerContext)
      throws WebAppConfigurationException, ClassNotFoundException,
      IllegalAccessException, InstantiationException {
    WebAppConfiguration globalConfig;
    try {
      globalConfig =
          GlobalConfigurationFactory.getGlobalConfiguration(classLoader);
    } catch (IOException e) {
      throw new WebAppConfigurationException("", e);
View Full Code Here

TOP

Related Classes of com.google.opengse.configuration.WebAppConfiguration

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.