r962 - in xwiki/trunk/src/main: . java/com/xpn/xwiki java/com/xpn/xwiki/objects java/com/xpn/xwiki/objects/classes java/com/xpn/xwiki/store java/com/xpn/xwiki/web web

Phung Hai Nam namphunghai at users.forge.objectweb.org
Mon Mar 6 07:52:30 CET 2006


Author: namphunghai
Date: 2006-03-06 07:52:29 +0100 (Mon, 06 Mar 2006)
New Revision: 962

Added:
   xwiki/trunk/src/main/web/error.jsp
Modified:
   xwiki/trunk/src/main/java/com/xpn/xwiki/XWiki.java
   xwiki/trunk/src/main/java/com/xpn/xwiki/XWikiException.java
   xwiki/trunk/src/main/java/com/xpn/xwiki/objects/BaseCollection.java
   xwiki/trunk/src/main/java/com/xpn/xwiki/objects/classes/PropertyClass.java
   xwiki/trunk/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java
   xwiki/trunk/src/main/java/com/xpn/xwiki/web/XWikiAction.java
   xwiki/trunk/src/main/web-exo.xml
   xwiki/trunk/src/main/web-test.xml
   xwiki/trunk/src/main/web.xml
   xwiki/trunk/src/main/web/index.html
Log:
Fixed bug with catching StringProperty and LargeStringProperty
Added error.jsp page for initialization error
Removed exception catching from getting base classes (they will stop instead of recreating an empty class)

Modified: xwiki/trunk/src/main/java/com/xpn/xwiki/XWiki.java
===================================================================
--- xwiki/trunk/src/main/java/com/xpn/xwiki/XWiki.java	2006-03-03 12:51:05 UTC (rev 961)
+++ xwiki/trunk/src/main/java/com/xpn/xwiki/XWiki.java	2006-03-06 06:52:29 UTC (rev 962)
@@ -43,8 +43,7 @@
 import com.xpn.xwiki.notify.XWikiNotificationRule;
 import com.xpn.xwiki.objects.BaseObject;
 import com.xpn.xwiki.objects.PropertyInterface;
-import com.xpn.xwiki.objects.classes.BaseClass;
-import com.xpn.xwiki.objects.classes.NumberClass;
+import com.xpn.xwiki.objects.classes.*;
 import com.xpn.xwiki.objects.meta.MetaClass;
 import com.xpn.xwiki.plugin.XWikiPluginInterface;
 import com.xpn.xwiki.plugin.XWikiPluginManager;
@@ -161,7 +160,7 @@
         return configPath;
     }
 
-    public static XWiki getMainXWiki(XWikiContext context) throws XWikiException {
+    public synchronized static XWiki getMainXWiki(XWikiContext context) throws XWikiException {
         String xwikicfg = null;
         String xwikiname = "xwiki";
         XWiki xwiki = null;
@@ -249,7 +248,7 @@
         return virtualWikiList;
     }
 
-    public static XWiki getXWiki(XWikiContext context) throws XWikiException {
+    public synchronized static XWiki getXWiki(XWikiContext context) throws XWikiException {
         XWiki xwiki = getMainXWiki(context);
 
         if (xwiki.isVirtual()) {
@@ -1396,18 +1395,11 @@
         }
     }
 
-    public BaseClass getUserClass(XWikiContext context) throws XWikiException {
+    public synchronized BaseClass getUserClass(XWikiContext context) throws XWikiException {
         XWikiDocument doc;
         boolean needsUpdate = false;
 
-        try {
-            doc = getDocument("XWiki.XWikiUsers", context);
-        } catch (Exception e) {
-            doc = new XWikiDocument();
-            doc.setWeb("XWiki");
-            doc.setName("XWikiUsers");
-            needsUpdate = true;
-        }
+        doc = getDocument("XWiki.XWikiUsers", context);
 
         BaseClass bclass = doc.getxWikiClass();
         if (context.get("initdone") != null)
@@ -1442,18 +1434,11 @@
     }
 
 
-    public BaseClass getPrefsClass(XWikiContext context) throws XWikiException {
+    public synchronized BaseClass getPrefsClass(XWikiContext context) throws XWikiException {
         XWikiDocument doc;
         boolean needsUpdate = false;
 
-        try {
-            doc = getDocument("XWiki.XWikiPreferences", context);
-        } catch (Exception e) {
-            doc = new XWikiDocument();
-            doc.setWeb("XWiki");
-            doc.setName("XWikiPreferences");
-            needsUpdate = true;
-        }
+        doc = getDocument("XWiki.XWikiPreferences", context);
 
         BaseClass bclass = doc.getxWikiClass();
         if (context.get("initdone") != null)
@@ -1515,7 +1500,7 @@
         if (menu.indexOf("../..") != -1) {
             MenuSubstitution msubst = new MenuSubstitution(context.getUtil());
             menu = msubst.substitute(menu);
-            doc.setStringValue("XWiki.XWikiPreferences", "menu", menu);
+            doc.setLargeStringValue("XWiki.XWikiPreferences", "menu", menu);
             needsUpdate = true;
         }
 
@@ -1524,7 +1509,7 @@
         return bclass;
     }
 
-    public BaseClass getGroupClass(XWikiContext context) throws XWikiException {
+    public synchronized BaseClass getGroupClass(XWikiContext context) throws XWikiException {
         XWikiDocument doc;
         boolean needsUpdate = false;
 
@@ -1553,7 +1538,7 @@
     }
 
 
-    public BaseClass getRightsClass(String pagename, XWikiContext context) throws XWikiException {
+    public synchronized BaseClass getRightsClass(String pagename, XWikiContext context) throws XWikiException {
         XWikiDocument doc;
         boolean needsUpdate = false;
 
@@ -1590,26 +1575,19 @@
         return bclass;
     }
 
-    public BaseClass getRightsClass(XWikiContext context) throws XWikiException {
+    public synchronized BaseClass getRightsClass(XWikiContext context) throws XWikiException {
         return getRightsClass("XWikiRights", context);
     }
 
-    public BaseClass getGlobalRightsClass(XWikiContext context) throws XWikiException {
+    public synchronized BaseClass getGlobalRightsClass(XWikiContext context) throws XWikiException {
         return getRightsClass("XWikiGlobalRights", context);
     }
 
-    public BaseClass getCommentsClass(XWikiContext context) throws XWikiException {
+    public synchronized BaseClass getCommentsClass(XWikiContext context) throws XWikiException {
         XWikiDocument doc;
         boolean needsUpdate = false;
 
-        try {
-            doc = getDocument("XWiki.XWikiComments", context);
-        } catch (Exception e) {
-            doc = new XWikiDocument();
-            doc.setWeb("XWiki");
-            doc.setName("XWikiComments");
-            needsUpdate = true;
-        }
+        doc = getDocument("XWiki.XWikiComments", context);
 
         BaseClass bclass = doc.getxWikiClass();
         if (context.get("initdone") != null)
@@ -1634,18 +1612,11 @@
         return bclass;
     }
 
-    public BaseClass getSkinClass(XWikiContext context) throws XWikiException {
+    public synchronized BaseClass getSkinClass(XWikiContext context) throws XWikiException {
         XWikiDocument doc;
         boolean needsUpdate = false;
 
-        try {
-            doc = getDocument("XWiki.XWikiSkins", context);
-        } catch (Exception e) {
-            doc = new XWikiDocument();
-            doc.setWeb("XWiki");
-            doc.setName("XWikiSkins");
-            needsUpdate = true;
-        }
+        doc = getDocument("XWiki.XWikiSkins", context);
 
         BaseClass bclass = doc.getxWikiClass();
         if (context.get("initdone") != null)

Modified: xwiki/trunk/src/main/java/com/xpn/xwiki/XWikiException.java
===================================================================
--- xwiki/trunk/src/main/java/com/xpn/xwiki/XWikiException.java	2006-03-03 12:51:05 UTC (rev 961)
+++ xwiki/trunk/src/main/java/com/xpn/xwiki/XWikiException.java	2006-03-06 06:52:29 UTC (rev 962)
@@ -1,27 +1,27 @@
-/*
- * Copyright 2006, XpertNet SARL, and individual contributors as indicated
- * by the contributors.txt.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- *
- * @author ludovic
- * @author namphunghai
- * @author sdumitriu
- * @author thomas
- */
+/*
+ * Copyright 2006, XpertNet SARL, and individual contributors as indicated
+ * by the contributors.txt.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *
+ * @author ludovic
+ * @author namphunghai
+ * @author sdumitriu
+ * @author thomas
+ */
 
 package com.xpn.xwiki;
 
@@ -136,6 +136,7 @@
     public static final int ERROR_XWIKI_CLASSES_DIFF = 7003;
     public static final int ERROR_XWIKI_CLASSES_CUSTOMCLASSINVOCATIONERROR = 7004;
     public static final int ERROR_XWIKI_CLASSES_PROPERTY_CLASS_INSTANCIATION = 7005;
+    public static final int ERROR_XWIKI_CLASSES_PROPERTY_CLASS_IN_METACLASS = 7006;
 
 
     public static final int ERROR_XWIKI_USER_INIT = 8001;

Modified: xwiki/trunk/src/main/java/com/xpn/xwiki/objects/BaseCollection.java
===================================================================
--- xwiki/trunk/src/main/java/com/xpn/xwiki/objects/BaseCollection.java	2006-03-03 12:51:05 UTC (rev 961)
+++ xwiki/trunk/src/main/java/com/xpn/xwiki/objects/BaseCollection.java	2006-03-06 06:52:29 UTC (rev 962)
@@ -1,26 +1,26 @@
-/*
- * Copyright 2006, XpertNet SARL, and individual contributors as indicated
- * by the contributors.txt.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- *
- * @author ludovic
- * @author erwan
- * @author sdumitriu
- */
+/*
+ * Copyright 2006, XpertNet SARL, and individual contributors as indicated
+ * by the contributors.txt.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *
+ * @author ludovic
+ * @author erwan
+ * @author sdumitriu
+ */
 
 package com.xpn.xwiki.objects;
 
@@ -145,14 +145,18 @@
            return getStringValue(name);
        }
     public void setStringValue(String name, String value) {
-        StringProperty property = new StringProperty();
+        BaseStringProperty property = (BaseStringProperty) safeget(name);
+        if (property==null)
+         property = new StringProperty();
         property.setName(name);
         property.setValue(value);
         safeput(name, property);
     }
 
     public void setLargeStringValue(String name, String value) {
-        LargeStringProperty property = new LargeStringProperty();
+        BaseStringProperty property = (BaseStringProperty) safeget(name);
+        if (property==null)
+         property = new LargeStringProperty();
         property.setName(name);
         property.setValue(value);
         safeput(name, property);

Modified: xwiki/trunk/src/main/java/com/xpn/xwiki/objects/classes/PropertyClass.java
===================================================================
--- xwiki/trunk/src/main/java/com/xpn/xwiki/objects/classes/PropertyClass.java	2006-03-03 12:51:05 UTC (rev 961)
+++ xwiki/trunk/src/main/java/com/xpn/xwiki/objects/classes/PropertyClass.java	2006-03-06 06:52:29 UTC (rev 962)
@@ -1,25 +1,25 @@
-/*
- * Copyright 2006, XpertNet SARL, and individual contributors as indicated
- * by the contributors.txt.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- *
- * @author ludovic
- * @author sdumitriu
- */
+/*
+ * Copyright 2006, XpertNet SARL, and individual contributors as indicated
+ * by the contributors.txt.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *
+ * @author ludovic
+ * @author sdumitriu
+ */
 
 package com.xpn.xwiki.objects.classes;
 
@@ -249,13 +249,18 @@
         return pel;
      }
 
-    public void fromXML(Element pcel) {
+    public void fromXML(Element pcel) throws XWikiException {
      List list = pcel.elements();
      BaseClass bclass = getxWikiClass();
 
      for (int i=0;i<list.size();i++) {
         Element ppcel = (Element) list.get(i);
         String name = ppcel.getName();
+        if (bclass==null) {
+            Object[] args = { getClass().getName() };
+            throw new XWikiException( XWikiException.MODULE_XWIKI_CLASSES, XWikiException.ERROR_XWIKI_CLASSES_PROPERTY_CLASS_IN_METACLASS,
+                    "Cannot find property class {0} in MetaClass object", null, args);
+        }
         PropertyClass pclass = (PropertyClass) bclass.safeget(name);
         if (pclass!=null) {
          BaseProperty bprop = pclass.newPropertyfromXML(ppcel);

Modified: xwiki/trunk/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java
===================================================================
--- xwiki/trunk/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java	2006-03-03 12:51:05 UTC (rev 961)
+++ xwiki/trunk/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java	2006-03-06 06:52:29 UTC (rev 962)
@@ -39,6 +39,8 @@
 import com.xpn.xwiki.objects.*;
 import com.xpn.xwiki.objects.classes.BaseClass;
 import com.xpn.xwiki.objects.classes.PropertyClass;
+import com.xpn.xwiki.objects.classes.TextAreaClass;
+import com.xpn.xwiki.objects.classes.StringClass;
 import com.xpn.xwiki.util.Util;
 import com.xpn.xwiki.web.XWikiRequest;
 import org.apache.commons.jrcs.rcs.Archive;
@@ -1337,10 +1339,46 @@
                     if (handledProps.contains(name))
                       continue;
                     String classType = (String)result[1];
-                    BaseProperty property = (BaseProperty) Class.forName(classType).newInstance();
-                    property.setObject(object);
-                    property.setName(name);
-                    loadXWikiProperty(property, context, false);
+                    BaseProperty property = null;
+
+                    try {
+                        property = (BaseProperty) Class.forName(classType).newInstance();
+                        property.setObject(object);
+                        property.setName(name);
+                        loadXWikiProperty(property, context, false);
+                    } catch (Exception e) {
+                        // WORKAROUND IN CASE OF MIXMATCH BETWEEN STRING AND LARGESTRING
+                        try {
+                            if (property instanceof StringProperty) {
+                                LargeStringProperty property2 = new LargeStringProperty();
+                                property2.setObject(object);
+                                property2.setName(name);
+                                loadXWikiProperty(property2, context, false);
+                                property.setValue(property2.getValue());
+
+                                if (bclass!=null) {
+                                    if (bclass.get(name) instanceof TextAreaClass)
+                                     property = property2;
+                                }
+
+                            } else if (property instanceof LargeStringProperty) {
+                                StringProperty property2 = new StringProperty();
+                                property2.setObject(object);
+                                property2.setName(name);
+                                loadXWikiProperty(property2, context, false);
+                                property.setValue(property2.getValue());
+
+                                if (bclass!=null) {
+                                    if (bclass.get(name) instanceof StringClass)
+                                     property = property2;
+                                }
+                            } else
+                                throw e;
+                        } catch (Throwable e2) {
+                            throw e;
+                        }
+                    }
+
                     object.addField(name, property);
                 }
             }
@@ -1470,7 +1508,7 @@
             BaseCollection obj = property.getObject();
             Object[] args = { (obj!=null) ? obj.getName() : "unknown", property.getName() };
             throw new XWikiException( XWikiException.MODULE_XWIKI_STORE, XWikiException.ERROR_XWIKI_STORE_HIBERNATE_LOADING_OBJECT,
-                    "Exception while saving property {1} of object {0}", e, args);
+                    "Exception while loading property {1} of object {0}", e, args);
 
         } finally {
             try {

Modified: xwiki/trunk/src/main/java/com/xpn/xwiki/web/XWikiAction.java
===================================================================
--- xwiki/trunk/src/main/java/com/xpn/xwiki/web/XWikiAction.java	2006-03-03 12:51:05 UTC (rev 961)
+++ xwiki/trunk/src/main/java/com/xpn/xwiki/web/XWikiAction.java	2006-03-06 06:52:29 UTC (rev 962)
@@ -107,6 +107,8 @@
                     response.sendRedirect(redirect);
                     return null;
                 }
+                else
+                  throw e;
             }
 
             // Parses multipart so that parms in multipart are available for all actions

Added: xwiki/trunk/src/main/web/error.jsp
===================================================================
--- xwiki/trunk/src/main/web/error.jsp	2006-03-03 12:51:05 UTC (rev 961)
+++ xwiki/trunk/src/main/web/error.jsp	2006-03-06 06:52:29 UTC (rev 962)
@@ -0,0 +1,83 @@
+<%@ page isErrorPage="true" %>
+<%@ page language="java" %>
+<%@ page import="java.util.*" %>
+<%@ page import="java.io.PrintWriter"%>
+<%
+    Object statusCode = request.getAttribute("javax.servlet.error.status_code");
+    Object exceptionType = request.getAttribute("javax.servlet.error.exception_type");
+    Object message = request.getAttribute("javax.servlet.error.message");
+%>
+
+<html>
+<head>
+<title>XWiki Initialization Error</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<script type="text/javascript">
+<!--
+function showhide(divname) {
+ var style = document.getElementById(divname).style;
+ if ((style.display=='block')||(style.display=='')) {
+  style.display='none';
+  }
+ else {
+  style.display='block';
+  }
+}
+// -->
+</script>
+</head>
+<body bgcolor="#FFFFFF">
+<H2>XWiki Initialization Error</H2>
+<p>
+An error occured. Please contact the administrator of this server.
+</p>
+<a href="" onclick="showhide('details'); return false;">Show details</a>
+<br />
+<div id="details" style="display:none;">
+<TABLE CELLPADDING="2" CELLSPACING="2" BORDER="1" WIDTH="100%">
+    <TR>
+	<TD WIDTH="20%"><B>Status Code</B></TD>
+	<TD WIDTH="80%"><%= statusCode %></TD>
+    </TR>
+    <TR>
+	<TD WIDTH="20%"><B>Exception Type</B></TD>
+	<TD WIDTH="80%"><%= exceptionType %></TD>
+    </TR>
+    <TR>
+	<TD WIDTH="20%"><B>Message</B></TD>
+	<TD WIDTH="80%"><%= message %></TD>
+    </TR>
+    <TR>
+	<TD WIDTH="20%"><B>Exception</B></TD>
+	<TD WIDTH="80%">
+	    <%
+		if( exception != null )
+		{
+		    out.print("<PRE>");
+		    exception.printStackTrace(new PrintWriter(out));
+		    out.print("</PRE>");
+		}
+	    %>
+	</TD>
+    </TR>
+    <TR>
+	<TD WIDTH="20%"><B>Root Cause</B></TD>
+	<TD>
+	    <%
+		if( (exception != null) && (exception instanceof ServletException) )
+		{
+		    Throwable cause = ((ServletException)exception).getRootCause();
+		    if( cause != null )
+		    {
+			out.print("<PRE>");
+			cause.printStackTrace(new PrintWriter(out));
+			out.print("</PRE>");
+		    }
+		}
+	    %>
+	</TD>
+    </TR>
+</TABLE>
+</div>
+</body>
+</html>
\ No newline at end of file

Modified: xwiki/trunk/src/main/web/index.html
===================================================================
--- xwiki/trunk/src/main/web/index.html	2006-03-03 12:51:05 UTC (rev 961)
+++ xwiki/trunk/src/main/web/index.html	2006-03-06 06:52:29 UTC (rev 962)
@@ -13,4 +13,5 @@
 <li><a href="install.txt">Installation Instructions</a></li>
 <li><a href="/xwiki/bin/view/Main/WebHome">XWiki Home Page</a></li>
 </ul>
-</body>
\ No newline at end of file
+</body>
+</html>
\ No newline at end of file

Modified: xwiki/trunk/src/main/web-exo.xml
===================================================================
--- xwiki/trunk/src/main/web-exo.xml	2006-03-03 12:51:05 UTC (rev 961)
+++ xwiki/trunk/src/main/web-exo.xml	2006-03-06 06:52:29 UTC (rev 962)
@@ -111,6 +111,15 @@
         <url-pattern>/xwiki/*</url-pattern>
     </servlet-mapping>
 
+    <error-page>
+      <error-code>500</error-code>
+      <location>/error.jsp</location>
+    </error-page>
+    <error-page>
+      <error-code>404</error-code>
+      <location>/error.jsp</location>
+    </error-page>
+
     <!-- The Usual Welcome File List -->
     <welcome-file-list>
         <welcome-file>index.html</welcome-file>

Modified: xwiki/trunk/src/main/web-test.xml
===================================================================
--- xwiki/trunk/src/main/web-test.xml	2006-03-03 12:51:05 UTC (rev 961)
+++ xwiki/trunk/src/main/web-test.xml	2006-03-06 06:52:29 UTC (rev 962)
@@ -112,7 +112,16 @@
         <url-pattern>/xwiki/*</url-pattern>
     </servlet-mapping>
 
-    <!-- The Usual Welcome File List -->
+    <error-page>
+          <error-code>500</error-code>
+          <location>/error.jsp</location>
+    </error-page>
+    <error-page>
+          <error-code>404</error-code>
+          <location>/error.jsp</location>
+    </error-page>
+
+     <!-- The Usual Welcome File List -->
     <welcome-file-list>
         <welcome-file>index.html</welcome-file>
     </welcome-file-list>

Modified: xwiki/trunk/src/main/web.xml
===================================================================
--- xwiki/trunk/src/main/web.xml	2006-03-03 12:51:05 UTC (rev 961)
+++ xwiki/trunk/src/main/web.xml	2006-03-06 06:52:29 UTC (rev 962)
@@ -86,11 +86,21 @@
         <url-pattern>/xwiki/*</url-pattern>
     </servlet-mapping>
 
+
     <!-- The Usual Welcome File List -->
     <welcome-file-list>
         <welcome-file>index.html</welcome-file>
     </welcome-file-list>
 
+    <error-page>
+      <error-code>500</error-code>
+      <location>/error.jsp</location>
+    </error-page>
+    <error-page>
+      <error-code>404</error-code>
+      <location>/error.jsp</location>
+    </error-page>
+
     <!-- Example Application Tag Library Descriptor
 <taglib>
 <taglib-uri>/WEB-INF/app.tld</taglib-uri>





More information about the Xwiki-notifications mailing list