Author: snoopdave
Date: Sun Jan 24 23:19:51 2010
New Revision: 902675

URL: http://svn.apache.org/viewvc?rev=902675&view=rev
Log:
Have mvn jetty:run-war working now but only up to a point. Roller starts and 
you can create a user but logging in does not seem to work. To make this small 
bit of progress, I had to create a Jetty LifeCycle implementation to start and 
stop Derby. And switch over to property based DB configuation because I could 
not figure out how to get the Maven Jetty plugin setup JNDI properly.


Added:
    roller/trunk/test-utils/src/main/java/org/apache/roller/weblogger/jetty/
    
roller/trunk/test-utils/src/main/java/org/apache/roller/weblogger/jetty/DerbyLifeCycle.java
    roller/trunk/weblogger-web/src/test/resources/jetty.xml
    roller/trunk/weblogger-web/src/test/resources/realm.properties
    roller/trunk/weblogger-web/src/test/resources/webdefault.xml
Removed:
    roller/trunk/weblogger-web/src/test/resources/jetty-env.xml
Modified:
    roller/trunk/test-utils/pom.xml
    roller/trunk/weblogger-web/pom.xml
    roller/trunk/weblogger-web/src/main/webapp/WEB-INF/jsps/tiles/messages.jsp
    roller/trunk/weblogger-web/src/test/resources/planet-custom.properties
    roller/trunk/weblogger-web/src/test/resources/roller-custom.properties

Modified: roller/trunk/test-utils/pom.xml
URL: 
http://svn.apache.org/viewvc/roller/trunk/test-utils/pom.xml?rev=902675&r1=902674&r2=902675&view=diff
==============================================================================
--- roller/trunk/test-utils/pom.xml (original)
+++ roller/trunk/test-utils/pom.xml Sun Jan 24 23:19:51 2010
@@ -1,9 +1,9 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0";
-     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
-     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
 
     <modelVersion>4.0.0</modelVersion>
-    
+
     <parent>
         <groupId>org.apache.roller</groupId>
         <artifactId>roller-project</artifactId>
@@ -12,36 +12,55 @@
     </parent>
 
     <name>Apache Roller Test Utilities</name>
-    <groupId>org.apache.roller</groupId> 
-    <artifactId>test-utils</artifactId> 
+    <groupId>org.apache.roller</groupId>
+    <artifactId>test-utils</artifactId>
     <version>5.0-BETA2-SNAPSHOT</version>
-    
+
     <dependencies>
-    
+
         <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
             <scope>compile</scope>
         </dependency>
-        
+
         <dependency>
             <groupId>org.apache.ant</groupId>
             <artifactId>ant</artifactId>
             <scope>compile</scope>
         </dependency>
-        
+
+        <dependency>
+            <groupId>commons-logging</groupId>
+            <artifactId>commons-logging</artifactId>
+            <scope>compile</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.derby</groupId>
+            <artifactId>derbyclient</artifactId>
+            <scope>compile</scope>
+        </dependency>
+
         <dependency>
             <groupId>org.apache.derby</groupId>
             <artifactId>derby</artifactId>
             <scope>compile</scope>
         </dependency>
-        
+
         <dependency>
             <groupId>org.apache.derby</groupId>
             <artifactId>derbynet</artifactId>
             <scope>compile</scope>
         </dependency>
-            
+
+        <dependency>
+            <groupId>org.mortbay.jetty</groupId>
+            <artifactId>jetty</artifactId>
+            <version>6.1.10</version>
+            <scope>compile</scope>
+        </dependency>
+
     </dependencies>
-    
+
 </project>

Added: 
roller/trunk/test-utils/src/main/java/org/apache/roller/weblogger/jetty/DerbyLifeCycle.java
URL: 
http://svn.apache.org/viewvc/roller/trunk/test-utils/src/main/java/org/apache/roller/weblogger/jetty/DerbyLifeCycle.java?rev=902675&view=auto
==============================================================================
--- 
roller/trunk/test-utils/src/main/java/org/apache/roller/weblogger/jetty/DerbyLifeCycle.java
 (added)
+++ 
roller/trunk/test-utils/src/main/java/org/apache/roller/weblogger/jetty/DerbyLifeCycle.java
 Sun Jan 24 23:19:51 2010
@@ -0,0 +1,137 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+
+package org.apache.roller.weblogger.jetty;
+
+import java.io.PrintWriter;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.derby.drda.NetworkServerControl;
+import org.mortbay.component.LifeCycle;
+
+
+/**
+ * Enables start and stop Derby from the Maven Jetty plugin.
+ */
+public class DerbyLifeCycle implements LifeCycle {
+    private static Log log =
+            LogFactory.getFactory().getInstance(DerbyLifeCycle.class);
+    private boolean started = false;
+    private boolean starting = false;
+    private boolean stopping= false;
+
+    private boolean failed = false;
+    private String database = null;
+    private String port = null;
+
+    public void start() throws Exception {
+        log.info("Starting Derby");
+        try {
+            System.setProperty("derby.system.home", database);
+            System.setProperty("derby.drda.portNumber", port);
+            System.setProperty("derby.drda.host", "localhost");
+            NetworkServerControl server = new NetworkServerControl();
+            server.start(new PrintWriter(System.out));
+            try {Thread.sleep(2000);} catch (Exception ignored) {}
+            started = true;
+            starting = false;
+            stopping = false;
+            failed = false;
+        } catch (Exception e) {
+            failed = true;
+            starting = false;
+            throw new Exception("Unable to start Derby. EXCEPTION: "
+                    + e.getClass().getName() + " Message: " + e.getMessage());
+        }
+    }
+
+    public void stop() throws Exception {
+        log.info("Starting Derby");
+        stopping = true;
+        try {
+            System.out.println("Stopping Derby");
+            System.setProperty("derby.drda.portNumber", port);
+            System.setProperty("derby.drda.host", "localhost");
+            NetworkServerControl server = new NetworkServerControl();
+            server.shutdown();
+            try {Thread.sleep(2000);} catch (Exception ignored) {}
+            started = false;
+            starting = false;
+            stopping = false;
+            failed = false;
+        } catch (Exception e) {
+            failed = true;
+            stopping = false;
+            throw new Exception("Unable to start Derby. EXCEPTION: "
+                    + e.getClass().getName() + " Message: " + e.getMessage());
+        }
+    }
+
+    /**
+     * @return Returns the database.
+     */
+    public String getDatabase() {
+        return database;
+    }
+
+    /**
+     * @param database The database to set.
+     */
+    public void setDatabase(String database) {
+        this.database = database;
+    }
+
+    /**
+     * @return Returns the port.
+     */
+    public String getPort() {
+        return port;
+    }
+
+    /**
+     * @param port The port to set.
+     */
+    public void setPort(String port) {
+        this.port = port;
+    }
+
+    public boolean isRunning() {
+        return started;
+    }
+
+    public boolean isStarted() {
+        return started;
+    }
+
+    public boolean isStarting() {
+        return starting;
+    }
+
+    public boolean isStopping() {
+        return stopping;
+    }
+
+    public boolean isStopped() {
+        return !started;
+    }
+
+    public boolean isFailed() {
+        return failed;
+    }
+
+}

Modified: roller/trunk/weblogger-web/pom.xml
URL: 
http://svn.apache.org/viewvc/roller/trunk/weblogger-web/pom.xml?rev=902675&r1=902674&r2=902675&view=diff
==============================================================================
--- roller/trunk/weblogger-web/pom.xml (original)
+++ roller/trunk/weblogger-web/pom.xml Sun Jan 24 23:19:51 2010
@@ -1,6 +1,6 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0";
-     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
-     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
 
     <modelVersion>4.0.0</modelVersion>
 
@@ -99,7 +99,7 @@
         <dependency>
             <groupId>org.apache.tiles</groupId>
             <artifactId>tiles-jsp</artifactId>
-             <!-- <exclusions>
+            <!-- <exclusions>
                  <exclusion>
                     <groupId>org.apache.tiles</groupId>
                     <artifactId>tiles-servlet</artifactId>
@@ -129,12 +129,12 @@
             <groupId>org.springframework</groupId>
             <artifactId>spring-web</artifactId>
             <version>2.5.6</version>
-             <exclusions>
-                 <exclusion>
+            <exclusions>
+                <exclusion>
                     <groupId>aopalliance</groupId>
                     <artifactId>aopalliance</artifactId>
                 </exclusion>
-             </exclusions>
+            </exclusions>
         </dependency>
 
         <dependency>
@@ -304,15 +304,15 @@
             <scope>provided</scope>
         </dependency>
 
-        <!-- test deps -->
-
         <dependency>
             <groupId>org.mortbay.jetty</groupId>
             <artifactId>jetty</artifactId>
             <version>6.1.10</version>
-            <scope>test</scope>
+            <scope>provided</scope>
         </dependency>
 
+        <!-- test deps -->
+
         <dependency>
             <groupId>commons-dbcp</groupId>
             <artifactId>commons-dbcp</artifactId>
@@ -326,11 +326,6 @@
             </exclusions>
         </dependency>
 
-        <dependency>
-            <groupId>org.apache.derby</groupId>
-            <artifactId>derbyclient</artifactId>
-            <scope>test</scope>
-        </dependency>
 
         <dependency>
             <groupId>simple-jndi</groupId>
@@ -381,18 +376,66 @@
                 <groupId>org.mortbay.jetty</groupId>
                 <artifactId>maven-jetty-plugin</artifactId>
                 <configuration>
+                    <!--
+                    
<jettyConfig>${project.build.directory}/jetty.xml</jettyConfig>
                     
<jettyEnvXml>${project.build.directory}/jetty-env.xml</jettyEnvXml>
+                    -->
                     <systemProperties>
+
+                        <systemProperty>
+                            <name>derby.dir</name>
+                            <value>${project.build.directory}/work</value>
+                        </systemProperty>
+
+                        <systemProperty>
+                            <name>config.dir</name>
+                            <value>${basedir}/src/test/resources</value>
+                        </systemProperty>
+
+                        <systemProperty>
+                            <name>jetty.home</name>
+                            <value>${basedir}/src/test/resources</value>
+                        </systemProperty>
+
+                        <systemProperty>
+                            <name>jetty.logs</name>
+                            <value>${basedir}/src/test/resources</value>
+                        </systemProperty>
+
+                        <systemProperty>
+                            <name>derby.port</name>
+                            <value>3219</value>
+                        </systemProperty>
+
                         <systemProperty>
                             <name>roller.custom.config</name>
                             
<value>${project.build.directory}/testsetup/roller-custom.properties</value>
                         </systemProperty>
+
                         <systemProperty>
                             <name>planet.custom.config</name>
                             
<value>${project.build.directory}/testsetup/planet-custom.properties</value>
                         </systemProperty>
+
                     </systemProperties>
                 </configuration>
+                <dependencies>
+                    <dependency>
+                        <groupId>org.apache.roller</groupId>
+                        <artifactId>test-utils</artifactId>
+                        <version>5.0-BETA2-SNAPSHOT</version>
+                    </dependency>
+                    <dependency>
+                        <groupId>log4j</groupId>
+                        <artifactId>log4j</artifactId>
+                        <version>1.2.12</version>
+                    </dependency>
+                    <dependency>
+                        <groupId>org.apache.roller</groupId>
+                        <artifactId>test-utils</artifactId>
+                        <version>5.0-BETA2-SNAPSHOT</version>
+                    </dependency>
+                </dependencies>
             </plugin>
 
             <plugin>
@@ -490,7 +533,7 @@
 
                     <execution>
                         <id>stopdb</id>
-                        <phase>package</phase>
+                        <phase>prepare-package</phase>
                         <goals>
                             <goal>run</goal>
                         </goals>

Modified: 
roller/trunk/weblogger-web/src/main/webapp/WEB-INF/jsps/tiles/messages.jsp
URL: 
http://svn.apache.org/viewvc/roller/trunk/weblogger-web/src/main/webapp/WEB-INF/jsps/tiles/messages.jsp?rev=902675&r1=902674&r2=902675&view=diff
==============================================================================
--- roller/trunk/weblogger-web/src/main/webapp/WEB-INF/jsps/tiles/messages.jsp 
(original)
+++ roller/trunk/weblogger-web/src/main/webapp/WEB-INF/jsps/tiles/messages.jsp 
Sun Jan 24 23:19:51 2010
@@ -20,7 +20,7 @@
 <%-- Success Messages --%>
 <s:if test="!actionMessages.isEmpty">
     <div id="messages" class="messages">
-        <s:actionmessage escape="false" />
+        <s:actionmessage />
     </div>
 </s:if>
 

Added: roller/trunk/weblogger-web/src/test/resources/jetty.xml
URL: 
http://svn.apache.org/viewvc/roller/trunk/weblogger-web/src/test/resources/jetty.xml?rev=902675&view=auto
==============================================================================
--- roller/trunk/weblogger-web/src/test/resources/jetty.xml (added)
+++ roller/trunk/weblogger-web/src/test/resources/jetty.xml Sun Jan 24 23:19:51 
2010
@@ -0,0 +1,40 @@
+<?xml version="1.0"?>
+<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" 
"http://jetty.mortbay.org/configure.dtd";>
+
+<Configure id="Server" class="org.mortbay.jetty.Server">
+
+<!-- Add lifecycle to start and stop Derby -->
+
+    <Call name="addLifeCycle">
+      <Arg>
+        <New class="org.apache.roller.weblogger.jetty.DerbyLifeCycle">
+            <Set name="database"><SystemProperty name="derby.dir" default="." 
/></Set>
+            <Set name="port"><SystemProperty name="derby.port" default="3219" 
/></Set>
+        </New>
+      </Arg>
+    </Call>
+
+<!-- Configure a log
+
+    <New id="ServerLog" class="java.io.PrintStream">
+      <Arg>
+        <New class="org.mortbay.util.RolloverFileOutputStream">
+          <Arg><SystemProperty name="jetty.home" 
default="."/>/yyyy_mm_dd.stderrout.log</Arg>
+          <Arg type="boolean">false</Arg>
+          <Arg type="int">90</Arg>
+          <Arg><Call class="java.util.TimeZone" 
name="getTimeZone"><Arg>GMT</Arg></Call></Arg>
+          <Get id="ServerLogName" name="datedFilename"/>
+        </New>
+      </Arg>
+    </New>
+
+    <Call class="org.mortbay.log.Log" name="info"><Arg>Redirecting 
stderr/stdout to <Ref id="ServerLogName"/></Arg></Call>
+    <Call class="java.lang.System" name="setErr"><Arg><Ref 
id="ServerLog"/></Arg></Call>
+    <Call class="java.lang.System" name="setOut"><Arg><Ref 
id="ServerLog"/></Arg></Call>
+ -->
+
+</Configure>
+
+
+
+

Modified: roller/trunk/weblogger-web/src/test/resources/planet-custom.properties
URL: 
http://svn.apache.org/viewvc/roller/trunk/weblogger-web/src/test/resources/planet-custom.properties?rev=902675&r1=902674&r2=902675&view=diff
==============================================================================
--- roller/trunk/weblogger-web/src/test/resources/planet-custom.properties 
(original)
+++ roller/trunk/weblogger-web/src/test/resources/planet-custom.properties Sun 
Jan 24 23:19:51 2010
@@ -1,3 +1,8 @@
 # Pluggable backend
 
guice.backend.module=org.apache.roller.weblogger.planet.business.jpa.RollerPlanetModule
 
+database.configurationType=jdbc
+database.jdbc.driverClass=org.apache.derby.jdbc.ClientDriver
+database.jdbc.connectionURL=jdbc:derby://localhost:3219/rollerdb
+database.jdbc.username=app
+database.jdbc.password=app

Added: roller/trunk/weblogger-web/src/test/resources/realm.properties
URL: 
http://svn.apache.org/viewvc/roller/trunk/weblogger-web/src/test/resources/realm.properties?rev=902675&view=auto
==============================================================================
--- roller/trunk/weblogger-web/src/test/resources/realm.properties (added)
+++ roller/trunk/weblogger-web/src/test/resources/realm.properties Sun Jan 24 
23:19:51 2010
@@ -0,0 +1,21 @@
+#
+# This file defines users passwords and roles for a HashUserRealm
+#
+# The format is
+#  <username>: <password>[,<rolename> ...]
+#
+# Passwords may be clear text, obfuscated or checksummed.  The class 
+# org.mortbay.util.Password should be used to generate obfuscated
+# passwords or password checksums
+#
+# If DIGEST Authentication is used, the password must be in a recoverable
+# format, either plain text or OBF:.
+#
+jetty: MD5:164c88b302622e17050af52c89945d44,user
+admin: CRYPT:ad1ks..kc.1Ug,server-administrator,content-administrator,admin
+other: OBF:1xmk1w261u9r1w1c1xmq
+plain: plain
+user: password
+
+# This entry is for digest auth.  The credential is a MD5 hash of 
username:realmname:password
+digest: MD5:6e120743ad67abfbc385bc2bb754e297

Modified: roller/trunk/weblogger-web/src/test/resources/roller-custom.properties
URL: 
http://svn.apache.org/viewvc/roller/trunk/weblogger-web/src/test/resources/roller-custom.properties?rev=902675&r1=902674&r2=902675&view=diff
==============================================================================
--- roller/trunk/weblogger-web/src/test/resources/roller-custom.properties 
(original)
+++ roller/trunk/weblogger-web/src/test/resources/roller-custom.properties Sun 
Jan 24 23:19:51 2010
@@ -1,5 +1,10 @@
 
-#openjpa.Log=DefaultLevel=WARN, Runtime=INFO, Tool=INFO, SQL=INFO
+database.configurationType=jdbc
+database.jdbc.driverClass=org.apache.derby.jdbc.ClientDriver
+database.jdbc.connectionURL=jdbc:derby://localhost:3219/rollerdb
+database.jdbc.username=app
+database.jdbc.password=app
+
 
 # use CMA authentication to work around Spring init issues in UI tests
 authentication.cma.enabled=true

Added: roller/trunk/weblogger-web/src/test/resources/webdefault.xml
URL: 
http://svn.apache.org/viewvc/roller/trunk/weblogger-web/src/test/resources/webdefault.xml?rev=902675&view=auto
==============================================================================
--- roller/trunk/weblogger-web/src/test/resources/webdefault.xml (added)
+++ roller/trunk/weblogger-web/src/test/resources/webdefault.xml Sun Jan 24 
23:19:51 2010
@@ -0,0 +1,412 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!-- ===================================================================== -->
+<!-- This file contains the default descriptor for web applications.       -->
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+<!-- The intent of this descriptor is to include jetty specific or common  -->
+<!-- configuration for all webapps.   If a context has a webdefault.xml    -->
+<!-- descriptor, it is applied before the contexts own web.xml file        -->
+<!--                                                                       -->
+<!-- A context may be assigned a default descriptor by:                    -->
+<!--  + Calling WebApplicationContext.setDefaultsDescriptor                -->
+<!--  + Passed an arg to addWebApplications                                -->
+<!--                                                                       -->
+<!-- This file is used both as the resource within the jetty.jar (which is -->
+<!-- used as the default if no explicit defaults descriptor is set) and it -->
+<!-- is copied to the etc directory of the Jetty distro and explicitly     -->
+<!-- by the jetty.xml file.                                                -->
+<!--                                                                       -->
+<!-- ===================================================================== -->
+<web-app 
+   xmlns="http://java.sun.com/xml/ns/javaee"; 
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+   xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"; 
+   metadata-complete="true"
+   version="2.5"> 
+
+  <description>
+    Default web.xml file.  
+    This file is applied to a Web application before it's own WEB_INF/web.xml 
file
+  </description>
+
+
+  <!-- ==================================================================== -->
+  <!-- Context params to control Session Cookies                            -->
+  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  -->
+  <!-- UNCOMMENT TO ACTIVATE
+  <context-param>
+    <param-name>org.mortbay.jetty.servlet.SessionDomain</param-name>
+    <param-value>127.0.0.1</param-value>
+  </context-param>
+
+  <context-param>
+    <param-name>org.mortbay.jetty.servlet.SessionPath</param-name>
+    <param-value>/</param-value>
+  </context-param>
+
+  <context-param>
+    <param-name>org.mortbay.jetty.servlet.MaxAge</param-name>
+    <param-value>-1</param-value>
+  </context-param>
+  -->
+
+  <context-param>
+    <param-name>org.mortbay.jetty.webapp.NoTLDJarPattern</param-name>
+    
<param-value>start.jar|ant-.*\.jar|dojo-.*\.jar|jetty-.*\.jar|jsp-api-.*\.jar|junit-.*\.jar|servlet-api-.*\.jar|dnsns\.jar|rt\.jar|jsse\.jar|tools\.jar|sunpkcs11\.jar|sunjce_provider\.jar|xerces.*\.jar</param-value>
+  </context-param>
+            
+
+
+  <!-- ==================================================================== -->
+  <!-- The default servlet.                                                 -->
+  <!-- This servlet, normally mapped to /, provides the handling for static -->
+  <!-- content, OPTIONS and TRACE methods for the context.                  -->
+  <!-- The following initParameters are supported:                          -->
+  <!--                                                                      -->
+  <!--   acceptRanges     If true, range requests and responses are         -->
+  <!--                    supported                                         -->
+  <!--                                                                      -->
+  <!--   dirAllowed       If true, directory listings are returned if no    -->
+  <!--                    welcome file is found. Else 403 Forbidden.        -->
+  <!--                                                                      -->
+  <!--   redirectWelcome  If true, redirect welcome file requests           -->
+  <!--                    else use request dispatcher forwards              -->
+  <!--                                                                      -->
+  <!--   gzip             If set to true, then static content will be 
served--> 
+  <!--                    as gzip content encoded if a matching resource is -->
+  <!--                    found ending with ".gz"                           -->
+  <!--                                                                      -->
+  <!--   resoureBase      Can be set to replace the context resource base   -->
+  <!--                                                                      -->
+  <!--   relativeResourceBase                                               -->
+  <!--                    Set with a pathname relative to the base of the   -->
+  <!--                    servlet context root. Useful for only serving     -->
+  <!--                    static content from only specific subdirectories. -->
+  <!--                                                                      -->
+  <!--   useFileMappedBuffer                                                -->
+  <!--                    If set to true (the default), a  memory mapped    -->
+  <!--                    file buffer will be used to serve static content  -->
+  <!--                    when using an NIO connector. Setting this value   -->
+  <!--                    to false means that a direct buffer will be used  -->
+  <!--                    instead. If you are having trouble with Windows   -->
+  <!--                    file locking, set this to false.                  -->
+  <!--                                                                      -->
+  <!--  cacheControl      If set, all static content will have this value   -->
+  <!--                    set as the cache-control header.                  -->
+  <!--                                                                      -->
+  <!--  maxCacheSize      Maximum size of the static resource cache         -->
+  <!--                                                                      -->
+  <!--  maxCachedFileSize Maximum size of any single file in the cache      -->
+  <!--                                                                      -->
+  <!--  maxCachedFiles    Maximum number of files in the cache              -->
+  <!--                                                                      -->
+  <!--  cacheType         "nio", "bio" or "both" to determine the type(s)   -->
+  <!--                    of resource cache. A bio cached buffer may be used-->
+  <!--                    by nio but is not as efficient as a nio buffer.   -->
+  <!--                    An nio cached buffer may not be used by bio.      -->
+  <!--                                                                      -->
+  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  -->
+  <servlet>
+    <servlet-name>default</servlet-name>
+    <servlet-class>org.mortbay.jetty.servlet.DefaultServlet</servlet-class>
+    <init-param>
+      <param-name>acceptRanges</param-name>
+      <param-value>true</param-value>
+    </init-param>
+    <init-param>
+      <param-name>dirAllowed</param-name>
+      <param-value>true</param-value>
+    </init-param>
+    <init-param>
+      <param-name>redirectWelcome</param-name>
+      <param-value>false</param-value>
+    </init-param>
+    <init-param>
+      <param-name>maxCacheSize</param-name>
+      <param-value>256000000</param-value>
+    </init-param>
+    <init-param>
+      <param-name>maxCachedFileSize</param-name>
+      <param-value>10000000</param-value>
+    </init-param>
+    <init-param>
+      <param-name>maxCachedFiles</param-name>
+      <param-value>1000</param-value>
+    </init-param>
+    <init-param>
+      <param-name>cacheType</param-name>
+      <param-value>both</param-value>
+    </init-param>
+    <init-param>
+      <param-name>gzip</param-name>
+      <param-value>true</param-value>
+    </init-param>
+    <init-param>
+      <param-name>useFileMappedBuffer</param-name>
+      <param-value>true</param-value>
+    </init-param>  
+    <!--
+    <init-param>
+      <param-name>cacheControl</param-name>
+      <param-value>max-age=3600,public</param-value>
+    </init-param>
+    -->
+    <load-on-startup>0</load-on-startup>
+  </servlet> 
+
+  <servlet-mapping> <servlet-name>default</servlet-name> 
<url-pattern>/</url-pattern> </servlet-mapping>
+  
+
+  <!-- ==================================================================== -->
+  <!-- JSP Servlet                                                          -->
+  <!-- This is the jasper JSP servlet from the jakarta project              -->
+  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  -->
+  <!-- The JSP page compiler and execution servlet, which is the mechanism  -->
+  <!-- used by Glassfish to support JSP pages.  Traditionally, this servlet -->
+  <!-- is mapped to URL patterh "*.jsp".  This servlet supports the         -->
+  <!-- following initialization parameters (default values are in square    -->
+  <!-- brackets):                                                           -->
+  <!--                                                                      -->
+  <!--   checkInterval       If development is false and reloading is true, -->
+  <!--                       background compiles are enabled. checkInterval -->
+  <!--                       is the time in seconds between checks to see   -->
+  <!--                       if a JSP page needs to be recompiled. [300]    -->
+  <!--                                                                      -->
+  <!--   compiler            Which compiler Ant should use to compile JSP   -->
+  <!--                       pages.  See the Ant documenation for more      -->
+  <!--                       information. [javac]                           -->
+  <!--                                                                      -->
+  <!--   classdebuginfo      Should the class file be compiled with         -->
+  <!--                       debugging information?  [true]                 -->
+  <!--                                                                      -->
+  <!--   classpath           What class path should I use while compiling   -->
+  <!--                       generated servlets?  [Created dynamically      -->
+  <!--                       based on the current web application]          -->
+  <!--                       Set to ? to make the container explicitly set  -->
+  <!--                       this parameter.                                -->
+  <!--                                                                      -->
+  <!--   development         Is Jasper used in development mode (will check -->
+  <!--                       for JSP modification on every access)?  [true] -->
+  <!--                                                                      -->
+  <!--   enablePooling       Determines whether tag handler pooling is      -->
+  <!--                       enabled  [true]                                -->
+  <!--                                                                      -->
+  <!--   fork                Tell Ant to fork compiles of JSP pages so that -->
+  <!--                       a separate JVM is used for JSP page compiles   -->
+  <!--                       from the one Tomcat is running in. [true]      -->
+  <!--                                                                      -->
+  <!--   ieClassId           The class-id value to be sent to Internet      -->
+  <!--                       Explorer when using <jsp:plugin> tags.         -->
+  <!--                       [clsid:8AD9C840-044E-11D1-B3E9-00805F499D93]   -->
+  <!--                                                                      -->
+  <!--   javaEncoding        Java file encoding to use for generating java  -->
+  <!--                       source files. [UTF-8]                          -->
+  <!--                                                                      -->
+  <!--   keepgenerated       Should we keep the generated Java source code  -->
+  <!--                       for each page instead of deleting it? [true]   -->
+  <!--                                                                      -->
+  <!--   logVerbosityLevel   The level of detailed messages to be produced  -->
+  <!--                       by this servlet.  Increasing levels cause the  -->
+  <!--                       generation of more messages.  Valid values are -->
+  <!--                       FATAL, ERROR, WARNING, INFORMATION, and DEBUG. -->
+  <!--                       [WARNING]                                      -->
+  <!--                                                                      -->
+  <!--   mappedfile          Should we generate static content with one     -->
+  <!--                       print statement per input line, to ease        -->
+  <!--                       debugging?  [false]                            -->
+  <!--                                                                      -->
+  <!--                                                                      -->
+  <!--   reloading           Should Jasper check for modified JSPs?  [true] -->
+  <!--                                                                      -->
+  <!--   suppressSmap        Should the generation of SMAP info for JSR45   -->
+  <!--                       debugging be suppressed?  [false]              -->
+  <!--                                                                      -->
+  <!--   dumpSmap            Should the SMAP info for JSR45 debugging be    -->
+  <!--                       dumped to a file? [false]                      -->
+  <!--                       False if suppressSmap is true                  -->
+  <!--                                                                      -->
+  <!--   scratchdir          What scratch directory should we use when      -->
+  <!--                       compiling JSP pages?  [default work directory  -->
+  <!--                       for the current web application]               -->
+  <!--                                                                      -->
+  <!--   tagpoolMaxSize      The maximum tag handler pool size  [5]         -->
+  <!--                                                                      -->
+  <!--   xpoweredBy          Determines whether X-Powered-By response       -->
+  <!--                       header is added by generated servlet  [false]  -->
+  <!--                                                                      -->
+  <!-- If you wish to use Jikes to compile JSP pages:                       -->
+  <!--   Set the init parameter "compiler" to "jikes".  Define              -->
+  <!--   the property "-Dbuild.compiler.emacs=true" when starting Jetty     -->
+  <!--   to cause Jikes to emit error messages in a format compatible with  -->
+  <!--   Jasper.                                                            -->
+  <!--   If you get an error reporting that jikes can't use UTF-8 encoding, -->
+  <!--   try setting the init parameter "javaEncoding" to "ISO-8859-1".     -->
+  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  -->
+  <servlet id="jsp">
+    <servlet-name>jsp</servlet-name>
+    <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
+    <init-param>
+        <param-name>logVerbosityLevel</param-name>
+        <param-value>DEBUG</param-value>
+    </init-param>
+    <init-param>
+        <param-name>fork</param-name>
+        <param-value>false</param-value>
+    </init-param>
+    <init-param>
+        <param-name>xpoweredBy</param-name>
+        <param-value>false</param-value>
+    </init-param>
+    <!--  
+    <init-param>
+        <param-name>classpath</param-name>
+        <param-value>?</param-value>
+    </init-param>
+    -->
+    <load-on-startup>0</load-on-startup>
+  </servlet>
+
+  <servlet-mapping> 
+    <servlet-name>jsp</servlet-name> 
+    <url-pattern>*.jsp</url-pattern> 
+    <url-pattern>*.jspf</url-pattern>
+    <url-pattern>*.jspx</url-pattern>
+    <url-pattern>*.xsp</url-pattern>
+    <url-pattern>*.JSP</url-pattern> 
+    <url-pattern>*.JSPF</url-pattern>
+    <url-pattern>*.JSPX</url-pattern>
+    <url-pattern>*.XSP</url-pattern>
+  </servlet-mapping>
+  
+  <!-- ==================================================================== -->
+  <!-- Dynamic Servlet Invoker.                                             -->
+  <!-- This servlet invokes anonymous servlets that have not been defined   -->
+  <!-- in the web.xml or by other means. The first element of the pathInfo  -->
+  <!-- of a request passed to the envoker is treated as a servlet name for  -->
+  <!-- an existing servlet, or as a class name of a new servlet.            -->
+  <!-- This servlet is normally mapped to /servlet/*                        -->
+  <!-- This servlet support the following initParams:                       -->
+  <!--                                                                      -->
+  <!--  nonContextServlets       If false, the invoker can only load        -->
+  <!--                           servlets from the contexts classloader.    -->
+  <!--                           This is false by default and setting this  -->
+  <!--                           to true may have security implications.    -->
+  <!--                                                                      -->
+  <!--  verbose                  If true, log dynamic loads                 -->
+  <!--                                                                      -->
+  <!--  *                        All other parameters are copied to the     -->
+  <!--                           each dynamic servlet as init parameters    -->
+  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  -->
+  <!-- Uncomment for dynamic invocation
+  <servlet>
+    <servlet-name>invoker</servlet-name>
+    <servlet-class>org.mortbay.jetty.servlet.Invoker</servlet-class>
+    <init-param>
+      <param-name>verbose</param-name>
+      <param-value>false</param-value>
+    </init-param>
+    <init-param>
+      <param-name>nonContextServlets</param-name>
+      <param-value>false</param-value>
+    </init-param>
+    <init-param>
+      <param-name>dynamicParam</param-name>
+      <param-value>anyValue</param-value>
+    </init-param>
+    <load-on-startup>0</load-on-startup>
+  </servlet>
+
+  <servlet-mapping> <servlet-name>invoker</servlet-name> 
<url-pattern>/servlet/*</url-pattern> </servlet-mapping>
+  -->
+
+
+
+  <!-- ==================================================================== -->
+  <session-config>
+    <session-timeout>30</session-timeout>
+  </session-config>
+
+  <!-- ==================================================================== -->
+  <!-- Default MIME mappings                                                -->
+  <!-- The default MIME mappings are provided by the mime.properties        -->
+  <!-- resource in the org.mortbay.jetty.jar file.  Additional or modified  -->
+  <!-- mappings may be specified here                                       -->
+  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  -->
+  <!-- UNCOMMENT TO ACTIVATE
+  <mime-mapping>
+    <extension>mysuffix</extension>
+    <mime-type>mymime/type</mime-type>
+  </mime-mapping>
+  -->
+
+  <!-- ==================================================================== -->
+  <welcome-file-list>
+    <welcome-file>index.html</welcome-file>
+    <welcome-file>index.htm</welcome-file>
+    <welcome-file>index.jsp</welcome-file>
+  </welcome-file-list>
+
+  <!-- ==================================================================== -->
+  <locale-encoding-mapping-list>
+    
<locale-encoding-mapping><locale>ar</locale><encoding>ISO-8859-6</encoding></locale-encoding-mapping>
+    
<locale-encoding-mapping><locale>be</locale><encoding>ISO-8859-5</encoding></locale-encoding-mapping>
+    
<locale-encoding-mapping><locale>bg</locale><encoding>ISO-8859-5</encoding></locale-encoding-mapping>
+    
<locale-encoding-mapping><locale>ca</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+    
<locale-encoding-mapping><locale>cs</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+    
<locale-encoding-mapping><locale>da</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+    
<locale-encoding-mapping><locale>de</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+    
<locale-encoding-mapping><locale>el</locale><encoding>ISO-8859-7</encoding></locale-encoding-mapping>
+    
<locale-encoding-mapping><locale>en</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+    
<locale-encoding-mapping><locale>es</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+    
<locale-encoding-mapping><locale>et</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+    
<locale-encoding-mapping><locale>fi</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+    
<locale-encoding-mapping><locale>fr</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+    
<locale-encoding-mapping><locale>hr</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+    
<locale-encoding-mapping><locale>hu</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+    
<locale-encoding-mapping><locale>is</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+    
<locale-encoding-mapping><locale>it</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+    
<locale-encoding-mapping><locale>iw</locale><encoding>ISO-8859-8</encoding></locale-encoding-mapping>
+    
<locale-encoding-mapping><locale>ja</locale><encoding>Shift_JIS</encoding></locale-encoding-mapping>
+    
<locale-encoding-mapping><locale>ko</locale><encoding>EUC-KR</encoding></locale-encoding-mapping>
     
+    
<locale-encoding-mapping><locale>lt</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+    
<locale-encoding-mapping><locale>lv</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+    
<locale-encoding-mapping><locale>mk</locale><encoding>ISO-8859-5</encoding></locale-encoding-mapping>
+    
<locale-encoding-mapping><locale>nl</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+    
<locale-encoding-mapping><locale>no</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+    
<locale-encoding-mapping><locale>pl</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+    
<locale-encoding-mapping><locale>pt</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+    
<locale-encoding-mapping><locale>ro</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+    
<locale-encoding-mapping><locale>ru</locale><encoding>ISO-8859-5</encoding></locale-encoding-mapping>
+    
<locale-encoding-mapping><locale>sh</locale><encoding>ISO-8859-5</encoding></locale-encoding-mapping>
+    
<locale-encoding-mapping><locale>sk</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+    
<locale-encoding-mapping><locale>sl</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+    
<locale-encoding-mapping><locale>sq</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+    
<locale-encoding-mapping><locale>sr</locale><encoding>ISO-8859-5</encoding></locale-encoding-mapping>
+    
<locale-encoding-mapping><locale>sv</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+    
<locale-encoding-mapping><locale>tr</locale><encoding>ISO-8859-9</encoding></locale-encoding-mapping>
+    
<locale-encoding-mapping><locale>uk</locale><encoding>ISO-8859-5</encoding></locale-encoding-mapping>
+    
<locale-encoding-mapping><locale>zh</locale><encoding>GB2312</encoding></locale-encoding-mapping>
+    
<locale-encoding-mapping><locale>zh_TW</locale><encoding>Big5</encoding></locale-encoding-mapping>
   
+  </locale-encoding-mapping-list>
+  
+  <security-constraint>
+    <web-resource-collection>
+      <web-resource-name>Disable TRACE</web-resource-name>
+      <url-pattern>/</url-pattern>
+      <http-method>TRACE</http-method>
+    </web-resource-collection>
+    <auth-constraint/>
+  </security-constraint>
+
+    <resource-ref>
+        <res-ref-name>jdbc/rollerdb</res-ref-name>
+        <res-type>javax.sql.DataSource</res-type>
+    </resource-ref>
+
+    <resource-ref>
+        <res-ref-name>mail/Session</res-ref-name>
+        <res-type>javax.mail.Session</res-type>
+    </resource-ref>
+    
+</web-app>
+


Reply via email to