You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@continuum.apache.org by ev...@apache.org on 2009/05/27 07:03:14 UTC

svn commit: r778998 - in /continuum/branches/continuum-1.3.x/continuum-webapp/src/main: java/org/apache/continuum/web/action/error/ resources/ webapp/ webapp/WEB-INF/ webapp/WEB-INF/jsp/error/

Author: evenisse
Date: Wed May 27 05:03:13 2009
New Revision: 778998

URL: http://svn.apache.org/viewvc?rev=778998&view=rev
Log:
[CONTINUUM-2205] Fix NPE on httpError page

Added:
    continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/continuum/web/action/error/
    continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/continuum/web/action/error/HttpError.java   (with props)
    continuum/branches/continuum-1.3.x/continuum-webapp/src/main/webapp/httpError.jsp   (with props)
Modified:
    continuum/branches/continuum-1.3.x/continuum-webapp/src/main/resources/struts.xml
    continuum/branches/continuum-1.3.x/continuum-webapp/src/main/webapp/WEB-INF/jsp/error/httpError.jsp
    continuum/branches/continuum-1.3.x/continuum-webapp/src/main/webapp/WEB-INF/web.xml

Added: continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/continuum/web/action/error/HttpError.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/continuum/web/action/error/HttpError.java?rev=778998&view=auto
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/continuum/web/action/error/HttpError.java (added)
+++ continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/continuum/web/action/error/HttpError.java Wed May 27 05:03:13 2009
@@ -0,0 +1,51 @@
+package org.apache.continuum.web.action.error;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  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.
+ */
+
+import org.apache.maven.continuum.web.action.ContinuumActionSupport;
+
+/**
+ * AboutAction:
+ *
+ * @author: Emmanuel Venisse <ev...@apache.org>
+ * @version: $Id:$
+ * @plexus.component role="com.opensymphony.xwork2.Action" role-hint="httpError"
+ */
+public class HttpError
+    extends ContinuumActionSupport
+{
+    private int errorCode;
+
+    public String execute()
+        throws Exception
+    {
+        return SUCCESS;
+    }
+
+    public int getErrorCode()
+    {
+        return errorCode;
+    }
+
+    public void setErrorCode( int errorCode )
+    {
+        this.errorCode = errorCode;
+    }
+}

Propchange: continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/continuum/web/action/error/HttpError.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/continuum/web/action/error/HttpError.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: continuum/branches/continuum-1.3.x/continuum-webapp/src/main/resources/struts.xml
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-webapp/src/main/resources/struts.xml?rev=778998&r1=778997&r2=778998&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-webapp/src/main/resources/struts.xml (original)
+++ continuum/branches/continuum-1.3.x/continuum-webapp/src/main/resources/struts.xml Wed May 27 05:03:13 2009
@@ -164,11 +164,14 @@
       <result type="redirect-action">groupSummary</result>
     </action>
 
+    <action name="httpError" class="httpError">
+      <result name="success">/WEB-INF/jsp/error/httpError.jsp</result>
+    </action>
+
     <action name="about" class="about">
       <result name="success">/WEB-INF/jsp/about.jsp</result>
     </action>
 
-
     <action name="companyInfo" class="companyInfo">
       <result name="success">/WEB-INF/jsp/components/companyLogo.jsp</result>
       <interceptor-ref name="basicStack" />

Modified: continuum/branches/continuum-1.3.x/continuum-webapp/src/main/webapp/WEB-INF/jsp/error/httpError.jsp
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-webapp/src/main/webapp/WEB-INF/jsp/error/httpError.jsp?rev=778998&r1=778997&r2=778998&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-webapp/src/main/webapp/WEB-INF/jsp/error/httpError.jsp (original)
+++ continuum/branches/continuum-1.3.x/continuum-webapp/src/main/webapp/WEB-INF/jsp/error/httpError.jsp Wed May 27 05:03:13 2009
@@ -33,79 +33,52 @@
       <c:when test="${param.errorCode == 404}">
         <s:text name="error.404.title"/>
       </c:when>
-      <c:when test="${param.errorCode == 405}">
-        <s:text name="error.405.title"/>
+      <c:when test="${param.errorCode == 500}">
+        <s:text name="error.500.title"/>
       </c:when>
       <c:otherwise>
         <s:text name="error.page.title"/>
       </c:otherwise>
     </c:choose>
   </title>
-  <link rel="stylesheet" type="text/css" href="<s:url value="/css/tigris.css" includeParams="none"/>" media="screen"/>
-  <link rel="stylesheet" type="text/css" href="<s:url value="/css/print.css" includeParams="none"/>" media="print"/>
-  <link rel="stylesheet" type="text/css" href="<s:url value="/css/extremecomponents.css" includeParams="none"/>" media="screen"/>
-  <link rel="shortcut icon" href="<s:url value="/favicon.ico" includeParams="none"/>" type="image/x-icon"/>
-
-  <script src="<s:url value="/scripts/tigris.js" includeParams="none"/>" type="text/javascript"></script>
 </head>
 
-<body onload="focus()" marginwidth="0" marginheight="0" class="composite">
-<s:include value="/WEB-INF/jsp/navigations/DefaultTop.jsp"/>
-
-<table id="main" border="0" cellpadding="4" cellspacing="0" width="100%">
-  <tbody>
-    <tr valign="top">
-      <td id="leftcol" width="180">
-        <br/> <br/>
-        <s:include value="/WEB-INF/jsp/navigations/Menu.jsp"/>
-      </td>
-      <td width="86%">
-        <br/>
-
-        <div id="bodycol">
-          <div class="app">
-            <div id="axial" class="h3">
-              <h3>
-                <c:choose>
-                  <c:when test="${param.errorCode == 403}">
-                    <s:text name="error.403.section.title"/>
-                  </c:when>
-                  <c:when test="${param.errorCode == 404}">
-                    <s:text name="error.404.section.title"/>
-                  </c:when>
-                  <c:when test="${param.errorCode == 405}">
-                    <s:text name="error.405.section.title"/>
-                  </c:when>
-                  <c:otherwise>
-                    The URL requested results to an unknown error.
-                  </c:otherwise>
-                </c:choose>
-              </h3>
+<body>
+  <div id="h3">
+    <h3>
+      <c:choose>
+        <c:when test="${param.errorCode == 403}">
+          <s:text name="error.403.section.title"/>
+        </c:when>
+        <c:when test="${param.errorCode == 404}">
+          <s:text name="error.404.section.title"/>
+        </c:when>
+        <c:when test="${param.errorCode == 500}">
+          <s:text name="error.500.section.title"/>
+        </c:when>
+        <c:otherwise>
+          The URL requested results to an unknown error (Error <s:property value="errorCode"/>).
+        </c:otherwise>
+      </c:choose>
+    </h3>
 
-              <div class="errormessage">
-                <c:choose>
-                  <c:when test="${param.errorCode == 403}">
-                    <s:text name="error.403.message"/>
-                  </c:when>
-                  <c:when test="${param.errorCode == 404}">
-                    <s:text name="error.404.message"/>
-                  </c:when>
-                  <c:when test="${param.errorCode == 405}">
-                    <s:text name="error.405.message"/>
-                  </c:when>
-                  <c:otherwise>
-                    The URL requested results to an unknown error.
-                  </c:otherwise>
-                </c:choose>
-              </div>
-            </div>
-          </div>
-        </div>
-      </td>
-    </tr>
-  </tbody>
-</table>
-<s:include value="/WEB-INF/jsp/navigations/DefaultBottom.jsp"/>
+    <div class="errormessage">
+      <c:choose>
+        <c:when test="${param.errorCode == 403}">
+          <s:text name="error.403.message"/>
+        </c:when>
+        <c:when test="${param.errorCode == 404}">
+          <s:text name="error.404.message"/>
+        </c:when>
+        <c:when test="${param.errorCode == 500}">
+          <s:text name="error.500.message"/>
+        </c:when>
+        <c:otherwise>
+          The URL requested results to an unknown error (Error <s:property value="errorCode"/>).
+        </c:otherwise>
+      </c:choose>
+    </div>
+  </div>
 </body>
 </html>
 </s:i18n>
\ No newline at end of file

Modified: continuum/branches/continuum-1.3.x/continuum-webapp/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-webapp/src/main/webapp/WEB-INF/web.xml?rev=778998&r1=778997&r2=778998&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-webapp/src/main/webapp/WEB-INF/web.xml (original)
+++ continuum/branches/continuum-1.3.x/continuum-webapp/src/main/webapp/WEB-INF/web.xml Wed May 27 05:03:13 2009
@@ -138,15 +138,15 @@
   
   <error-page>
     <error-code>403</error-code>
-    <location>/WEB-INF/jsp/error/httpError.jsp?errorCode=403</location>
+    <location>/httpError.jsp?errorCode=403</location>
   </error-page>
   <error-page>
     <error-code>404</error-code>
-    <location>/WEB-INF/jsp/error/httpError.jsp?errorCode=404</location>
+    <location>/httpError.jsp?errorCode=404</location>
   </error-page>
   <error-page>
     <error-code>500</error-code>
-    <location>/WEB-INF/jsp/error/httpError.jsp?errorCode=500</location>
+    <location>/httpError.jsp?errorCode=500</location>
   </error-page>
 
   <!-- [jspc-maven-plugin:post-compiled-jsps-as-servlets] -->

Added: continuum/branches/continuum-1.3.x/continuum-webapp/src/main/webapp/httpError.jsp
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-webapp/src/main/webapp/httpError.jsp?rev=778998&view=auto
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-webapp/src/main/webapp/httpError.jsp (added)
+++ continuum/branches/continuum-1.3.x/continuum-webapp/src/main/webapp/httpError.jsp Wed May 27 05:03:13 2009
@@ -0,0 +1,20 @@
+<%--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  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.
+  --%>
+
+<% response.sendRedirect(  request.getContextPath() + "/httpError.action?errorCode="+ request.getParameter( "errorCode" ) ); %>

Propchange: continuum/branches/continuum-1.3.x/continuum-webapp/src/main/webapp/httpError.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: continuum/branches/continuum-1.3.x/continuum-webapp/src/main/webapp/httpError.jsp
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision