This is an automated email from the ASF dual-hosted git repository.
jleroux pushed a commit to branch release18.12 in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git The following commit(s) were added to refs/heads/release18.12 by this push: new 2342e0e Improved: Improve error message page to support Theming (OFBIZ-10753) 2342e0e is described below commit 2342e0e8bc213d73ef0b6c88335072b1dde1eac2 Author: Nicolas Malin <[hidden email]> AuthorDate: Mon Mar 25 09:31:02 2019 +0000 Improved: Improve error message page to support Theming (OFBIZ-10753) When OFBiz raise an error, the framework use a jsp page to display it. I improved the error page generation to support also ftl template rendering and by this way extend the theme engine to support to overide it On controler.xml we can now use : <errorpage>/error/error.jsp</errorpage> or <errorpage>component://common/webcommon/error/Error.ftl</errorpage> (default configuration) On your theme you can add your own error page : <template> ... <template-file widget=menu location=component://common-theme/template/macro/HtmlMenuMacroLibrary.ftl/> + <template-file widget=error location=component://common-theme/template/ErrorPage.ftl/> </template> The component://common/webcommon/error/Error.ftl contains the logic theming connection and to simplify source code, all framework old error page (error.jsp) have been removed to centralize all on this new page. Thanks to Marine Desmarchelier for the error page design git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1856175 13f79535-47bb-0310-9956-ffa450edef68 --- .../accounting/webapp/accounting/error/error.jsp | 52 --- applications/accounting/webapp/ap/error/error.jsp | 52 --- applications/accounting/webapp/ar/error/error.jsp | 52 --- .../commonext/webapp/ofbizsetup/error/error.jsp | 52 --- .../content/webapp/content/error/error.jsp | 52 --- .../humanres/webapp/humanres/error/error.jsp | 52 --- .../webapp/manufacturing/error/error.jsp | 52 --- .../marketing/webapp/marketing/error/error.jsp | 53 --- applications/marketing/webapp/sfa/error/error.jsp | 53 --- applications/order/webapp/ordermgr/error/error.jsp | 52 --- applications/party/webapp/partymgr/error/error.jsp | 53 --- .../product/webapp/catalog/error/error.jsp | 53 --- .../product/webapp/facility/error/error.jsp | 53 --- .../workeffort/webapp/workeffort/error/error.jsp | 53 --- .../common/webcommon/WEB-INF/common-controller.xml | 2 +- framework/common/webcommon/error/Error.ftl | 42 ++ framework/resources/templates/error.jsp | 53 --- .../ofbiz/webapp/control/ControlServlet.java | 92 ++-- .../ofbiz/webapp/control/RequestHandler.java | 15 +- framework/webtools/webapp/webtools/error/error.jsp | 52 --- framework/widget/dtd/widget-theme.xsd | 3 +- .../org/apache/ofbiz/widget/model/ModelTheme.java | 17 + themes/common-theme/template/ErrorPage.ftl | 509 +++++++++++++++++++++ themes/common-theme/widget/Theme.xml | 1 + 24 files changed, 643 insertions(+), 877 deletions(-) diff --git a/applications/accounting/webapp/accounting/error/error.jsp b/applications/accounting/webapp/accounting/error/error.jsp deleted file mode 100644 index 5f4de01..0000000 --- a/applications/accounting/webapp/accounting/error/error.jsp +++ /dev/null @@ -1,52 +0,0 @@ -<%-- -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. ---%> -<%@ page import="org.apache.ofbiz.base.util.*" %> -<html> -<head> -<title>OFBiz Message</title> -<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> -</head> - -<% String errorMsg = (String) request.getAttribute("_ERROR_MESSAGE_"); %> - -<body bgcolor="#FFFFFF"> -<div align="center"> - <br/> - <table width="100%" border="1" height="200"> - <tr> - <td> - <table width="100%" border="0" height="200"> - <tr bgcolor="#CC6666"> - <td height="45"> - <div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="4" color="#FFFFFF"><b>:ERROR MESSAGE:</b></font></div> - </td> - </tr> - <tr> - <td> - <div align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><%=UtilFormatOut.replaceString(errorMsg, "\n", "<br/>")%></font></div> - </td> - </tr> - </table> - </td> - </tr> - </table> -</div> -<div align="center"></div> -</body> -</html> diff --git a/applications/accounting/webapp/ap/error/error.jsp b/applications/accounting/webapp/ap/error/error.jsp deleted file mode 100644 index 5f4de01..0000000 --- a/applications/accounting/webapp/ap/error/error.jsp +++ /dev/null @@ -1,52 +0,0 @@ -<%-- -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. ---%> -<%@ page import="org.apache.ofbiz.base.util.*" %> -<html> -<head> -<title>OFBiz Message</title> -<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> -</head> - -<% String errorMsg = (String) request.getAttribute("_ERROR_MESSAGE_"); %> - -<body bgcolor="#FFFFFF"> -<div align="center"> - <br/> - <table width="100%" border="1" height="200"> - <tr> - <td> - <table width="100%" border="0" height="200"> - <tr bgcolor="#CC6666"> - <td height="45"> - <div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="4" color="#FFFFFF"><b>:ERROR MESSAGE:</b></font></div> - </td> - </tr> - <tr> - <td> - <div align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><%=UtilFormatOut.replaceString(errorMsg, "\n", "<br/>")%></font></div> - </td> - </tr> - </table> - </td> - </tr> - </table> -</div> -<div align="center"></div> -</body> -</html> diff --git a/applications/accounting/webapp/ar/error/error.jsp b/applications/accounting/webapp/ar/error/error.jsp deleted file mode 100644 index 5f4de01..0000000 --- a/applications/accounting/webapp/ar/error/error.jsp +++ /dev/null @@ -1,52 +0,0 @@ -<%-- -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. ---%> -<%@ page import="org.apache.ofbiz.base.util.*" %> -<html> -<head> -<title>OFBiz Message</title> -<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> -</head> - -<% String errorMsg = (String) request.getAttribute("_ERROR_MESSAGE_"); %> - -<body bgcolor="#FFFFFF"> -<div align="center"> - <br/> - <table width="100%" border="1" height="200"> - <tr> - <td> - <table width="100%" border="0" height="200"> - <tr bgcolor="#CC6666"> - <td height="45"> - <div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="4" color="#FFFFFF"><b>:ERROR MESSAGE:</b></font></div> - </td> - </tr> - <tr> - <td> - <div align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><%=UtilFormatOut.replaceString(errorMsg, "\n", "<br/>")%></font></div> - </td> - </tr> - </table> - </td> - </tr> - </table> -</div> -<div align="center"></div> -</body> -</html> diff --git a/applications/commonext/webapp/ofbizsetup/error/error.jsp b/applications/commonext/webapp/ofbizsetup/error/error.jsp deleted file mode 100644 index 5f4de01..0000000 --- a/applications/commonext/webapp/ofbizsetup/error/error.jsp +++ /dev/null @@ -1,52 +0,0 @@ -<%-- -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. ---%> -<%@ page import="org.apache.ofbiz.base.util.*" %> -<html> -<head> -<title>OFBiz Message</title> -<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> -</head> - -<% String errorMsg = (String) request.getAttribute("_ERROR_MESSAGE_"); %> - -<body bgcolor="#FFFFFF"> -<div align="center"> - <br/> - <table width="100%" border="1" height="200"> - <tr> - <td> - <table width="100%" border="0" height="200"> - <tr bgcolor="#CC6666"> - <td height="45"> - <div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="4" color="#FFFFFF"><b>:ERROR MESSAGE:</b></font></div> - </td> - </tr> - <tr> - <td> - <div align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><%=UtilFormatOut.replaceString(errorMsg, "\n", "<br/>")%></font></div> - </td> - </tr> - </table> - </td> - </tr> - </table> -</div> -<div align="center"></div> -</body> -</html> diff --git a/applications/content/webapp/content/error/error.jsp b/applications/content/webapp/content/error/error.jsp deleted file mode 100644 index 5f4de01..0000000 --- a/applications/content/webapp/content/error/error.jsp +++ /dev/null @@ -1,52 +0,0 @@ -<%-- -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. ---%> -<%@ page import="org.apache.ofbiz.base.util.*" %> -<html> -<head> -<title>OFBiz Message</title> -<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> -</head> - -<% String errorMsg = (String) request.getAttribute("_ERROR_MESSAGE_"); %> - -<body bgcolor="#FFFFFF"> -<div align="center"> - <br/> - <table width="100%" border="1" height="200"> - <tr> - <td> - <table width="100%" border="0" height="200"> - <tr bgcolor="#CC6666"> - <td height="45"> - <div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="4" color="#FFFFFF"><b>:ERROR MESSAGE:</b></font></div> - </td> - </tr> - <tr> - <td> - <div align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><%=UtilFormatOut.replaceString(errorMsg, "\n", "<br/>")%></font></div> - </td> - </tr> - </table> - </td> - </tr> - </table> -</div> -<div align="center"></div> -</body> -</html> diff --git a/applications/humanres/webapp/humanres/error/error.jsp b/applications/humanres/webapp/humanres/error/error.jsp deleted file mode 100644 index 5f4de01..0000000 --- a/applications/humanres/webapp/humanres/error/error.jsp +++ /dev/null @@ -1,52 +0,0 @@ -<%-- -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. ---%> -<%@ page import="org.apache.ofbiz.base.util.*" %> -<html> -<head> -<title>OFBiz Message</title> -<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> -</head> - -<% String errorMsg = (String) request.getAttribute("_ERROR_MESSAGE_"); %> - -<body bgcolor="#FFFFFF"> -<div align="center"> - <br/> - <table width="100%" border="1" height="200"> - <tr> - <td> - <table width="100%" border="0" height="200"> - <tr bgcolor="#CC6666"> - <td height="45"> - <div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="4" color="#FFFFFF"><b>:ERROR MESSAGE:</b></font></div> - </td> - </tr> - <tr> - <td> - <div align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><%=UtilFormatOut.replaceString(errorMsg, "\n", "<br/>")%></font></div> - </td> - </tr> - </table> - </td> - </tr> - </table> -</div> -<div align="center"></div> -</body> -</html> diff --git a/applications/manufacturing/webapp/manufacturing/error/error.jsp b/applications/manufacturing/webapp/manufacturing/error/error.jsp deleted file mode 100644 index 5f4de01..0000000 --- a/applications/manufacturing/webapp/manufacturing/error/error.jsp +++ /dev/null @@ -1,52 +0,0 @@ -<%-- -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. ---%> -<%@ page import="org.apache.ofbiz.base.util.*" %> -<html> -<head> -<title>OFBiz Message</title> -<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> -</head> - -<% String errorMsg = (String) request.getAttribute("_ERROR_MESSAGE_"); %> - -<body bgcolor="#FFFFFF"> -<div align="center"> - <br/> - <table width="100%" border="1" height="200"> - <tr> - <td> - <table width="100%" border="0" height="200"> - <tr bgcolor="#CC6666"> - <td height="45"> - <div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="4" color="#FFFFFF"><b>:ERROR MESSAGE:</b></font></div> - </td> - </tr> - <tr> - <td> - <div align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><%=UtilFormatOut.replaceString(errorMsg, "\n", "<br/>")%></font></div> - </td> - </tr> - </table> - </td> - </tr> - </table> -</div> -<div align="center"></div> -</body> -</html> diff --git a/applications/marketing/webapp/marketing/error/error.jsp b/applications/marketing/webapp/marketing/error/error.jsp deleted file mode 100644 index 83f0147..0000000 --- a/applications/marketing/webapp/marketing/error/error.jsp +++ /dev/null @@ -1,53 +0,0 @@ -<%-- -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. ---%> - -<%@ page import="org.apache.ofbiz.base.util.*" %> -<html> -<head> -<title>OFBiz Message</title> -<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> -</head> - -<% String errorMsg = (String) request.getAttribute("_ERROR_MESSAGE_"); %> - -<body bgcolor="#FFFFFF"> -<div align="center"> - <br/> - <table width="100%" border="1" height="200"> - <tr> - <td> - <table width="100%" border="0" height="200"> - <tr bgcolor="#CC6666"> - <td height="45"> - <div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="4" color="#FFFFFF"><b>:ERROR MESSAGE:</b></font></div> - </td> - </tr> - <tr> - <td> - <div align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><%=UtilFormatOut.replaceString(errorMsg, "\n", "<br/>")%></font></div> - </td> - </tr> - </table> - </td> - </tr> - </table> -</div> -<div align="center"></div> -</body> -</html> diff --git a/applications/marketing/webapp/sfa/error/error.jsp b/applications/marketing/webapp/sfa/error/error.jsp deleted file mode 100644 index 83f0147..0000000 --- a/applications/marketing/webapp/sfa/error/error.jsp +++ /dev/null @@ -1,53 +0,0 @@ -<%-- -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. ---%> - -<%@ page import="org.apache.ofbiz.base.util.*" %> -<html> -<head> -<title>OFBiz Message</title> -<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> -</head> - -<% String errorMsg = (String) request.getAttribute("_ERROR_MESSAGE_"); %> - -<body bgcolor="#FFFFFF"> -<div align="center"> - <br/> - <table width="100%" border="1" height="200"> - <tr> - <td> - <table width="100%" border="0" height="200"> - <tr bgcolor="#CC6666"> - <td height="45"> - <div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="4" color="#FFFFFF"><b>:ERROR MESSAGE:</b></font></div> - </td> - </tr> - <tr> - <td> - <div align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><%=UtilFormatOut.replaceString(errorMsg, "\n", "<br/>")%></font></div> - </td> - </tr> - </table> - </td> - </tr> - </table> -</div> -<div align="center"></div> -</body> -</html> diff --git a/applications/order/webapp/ordermgr/error/error.jsp b/applications/order/webapp/ordermgr/error/error.jsp deleted file mode 100644 index 5f4de01..0000000 --- a/applications/order/webapp/ordermgr/error/error.jsp +++ /dev/null @@ -1,52 +0,0 @@ -<%-- -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. ---%> -<%@ page import="org.apache.ofbiz.base.util.*" %> -<html> -<head> -<title>OFBiz Message</title> -<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> -</head> - -<% String errorMsg = (String) request.getAttribute("_ERROR_MESSAGE_"); %> - -<body bgcolor="#FFFFFF"> -<div align="center"> - <br/> - <table width="100%" border="1" height="200"> - <tr> - <td> - <table width="100%" border="0" height="200"> - <tr bgcolor="#CC6666"> - <td height="45"> - <div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="4" color="#FFFFFF"><b>:ERROR MESSAGE:</b></font></div> - </td> - </tr> - <tr> - <td> - <div align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><%=UtilFormatOut.replaceString(errorMsg, "\n", "<br/>")%></font></div> - </td> - </tr> - </table> - </td> - </tr> - </table> -</div> -<div align="center"></div> -</body> -</html> diff --git a/applications/party/webapp/partymgr/error/error.jsp b/applications/party/webapp/partymgr/error/error.jsp deleted file mode 100644 index 83f0147..0000000 --- a/applications/party/webapp/partymgr/error/error.jsp +++ /dev/null @@ -1,53 +0,0 @@ -<%-- -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. ---%> - -<%@ page import="org.apache.ofbiz.base.util.*" %> -<html> -<head> -<title>OFBiz Message</title> -<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> -</head> - -<% String errorMsg = (String) request.getAttribute("_ERROR_MESSAGE_"); %> - -<body bgcolor="#FFFFFF"> -<div align="center"> - <br/> - <table width="100%" border="1" height="200"> - <tr> - <td> - <table width="100%" border="0" height="200"> - <tr bgcolor="#CC6666"> - <td height="45"> - <div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="4" color="#FFFFFF"><b>:ERROR MESSAGE:</b></font></div> - </td> - </tr> - <tr> - <td> - <div align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><%=UtilFormatOut.replaceString(errorMsg, "\n", "<br/>")%></font></div> - </td> - </tr> - </table> - </td> - </tr> - </table> -</div> -<div align="center"></div> -</body> -</html> diff --git a/applications/product/webapp/catalog/error/error.jsp b/applications/product/webapp/catalog/error/error.jsp deleted file mode 100644 index 83f0147..0000000 --- a/applications/product/webapp/catalog/error/error.jsp +++ /dev/null @@ -1,53 +0,0 @@ -<%-- -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. ---%> - -<%@ page import="org.apache.ofbiz.base.util.*" %> -<html> -<head> -<title>OFBiz Message</title> -<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> -</head> - -<% String errorMsg = (String) request.getAttribute("_ERROR_MESSAGE_"); %> - -<body bgcolor="#FFFFFF"> -<div align="center"> - <br/> - <table width="100%" border="1" height="200"> - <tr> - <td> - <table width="100%" border="0" height="200"> - <tr bgcolor="#CC6666"> - <td height="45"> - <div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="4" color="#FFFFFF"><b>:ERROR MESSAGE:</b></font></div> - </td> - </tr> - <tr> - <td> - <div align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><%=UtilFormatOut.replaceString(errorMsg, "\n", "<br/>")%></font></div> - </td> - </tr> - </table> - </td> - </tr> - </table> -</div> -<div align="center"></div> -</body> -</html> diff --git a/applications/product/webapp/facility/error/error.jsp b/applications/product/webapp/facility/error/error.jsp deleted file mode 100644 index 83f0147..0000000 --- a/applications/product/webapp/facility/error/error.jsp +++ /dev/null @@ -1,53 +0,0 @@ -<%-- -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. ---%> - -<%@ page import="org.apache.ofbiz.base.util.*" %> -<html> -<head> -<title>OFBiz Message</title> -<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> -</head> - -<% String errorMsg = (String) request.getAttribute("_ERROR_MESSAGE_"); %> - -<body bgcolor="#FFFFFF"> -<div align="center"> - <br/> - <table width="100%" border="1" height="200"> - <tr> - <td> - <table width="100%" border="0" height="200"> - <tr bgcolor="#CC6666"> - <td height="45"> - <div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="4" color="#FFFFFF"><b>:ERROR MESSAGE:</b></font></div> - </td> - </tr> - <tr> - <td> - <div align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><%=UtilFormatOut.replaceString(errorMsg, "\n", "<br/>")%></font></div> - </td> - </tr> - </table> - </td> - </tr> - </table> -</div> -<div align="center"></div> -</body> -</html> diff --git a/applications/workeffort/webapp/workeffort/error/error.jsp b/applications/workeffort/webapp/workeffort/error/error.jsp deleted file mode 100644 index 83f0147..0000000 --- a/applications/workeffort/webapp/workeffort/error/error.jsp +++ /dev/null @@ -1,53 +0,0 @@ -<%-- -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. ---%> - -<%@ page import="org.apache.ofbiz.base.util.*" %> -<html> -<head> -<title>OFBiz Message</title> -<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> -</head> - -<% String errorMsg = (String) request.getAttribute("_ERROR_MESSAGE_"); %> - -<body bgcolor="#FFFFFF"> -<div align="center"> - <br/> - <table width="100%" border="1" height="200"> - <tr> - <td> - <table width="100%" border="0" height="200"> - <tr bgcolor="#CC6666"> - <td height="45"> - <div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="4" color="#FFFFFF"><b>:ERROR MESSAGE:</b></font></div> - </td> - </tr> - <tr> - <td> - <div align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><%=UtilFormatOut.replaceString(errorMsg, "\n", "<br/>")%></font></div> - </td> - </tr> - </table> - </td> - </tr> - </table> -</div> -<div align="center"></div> -</body> -</html> diff --git a/framework/common/webcommon/WEB-INF/common-controller.xml b/framework/common/webcommon/WEB-INF/common-controller.xml index 45969fb..80407c6 100644 --- a/framework/common/webcommon/WEB-INF/common-controller.xml +++ b/framework/common/webcommon/WEB-INF/common-controller.xml @@ -23,7 +23,7 @@ under the License. <include location="component://common/webcommon/WEB-INF/handlers-controller.xml"/> <description>Common ControlServlet Configuration File</description> - <errorpage>/error/error.jsp</errorpage> + <errorpage>component://common/webcommon/error/Error.ftl</errorpage> <preprocessor> <!-- Events to run on every request before security (chains exempt) --> diff --git a/framework/common/webcommon/error/Error.ftl b/framework/common/webcommon/error/Error.ftl new file mode 100644 index 0000000..6090bc7 --- /dev/null +++ b/framework/common/webcommon/error/Error.ftl @@ -0,0 +1,42 @@ +<#-- +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. +--> +<#if !visualTheme?has_content> + <#-- Try to resolve the default theme--> + <#assign visualTheme = Static["org.apache.ofbiz.widget.model.ThemeFactory"].resolveVisualTheme(null)/> +</#if> +<#if visualTheme?has_content> + <#assign errorPageLocation = visualTheme.modelTheme.getErrorTemplateLocation('screen')/> +</#if> +<#if errorPageLocation?has_content> + <#include visualTheme.modelTheme.getErrorTemplateLocation('screen')/> +<#else> +<#-- Not error page found to we use a raw output --> +<html> +<head> + <title>OFBiz Message</title><meta http-equiv="Content-Type" content="text/html"> +</head> +<body bgcolor="#FFFFFF"> +<div align="center"> + <h1>ERROR MESSAGE</h1> + <hr> + <p>${request.getAttribute('_ERROR_MESSAGE_')?replace("\n", "<br/>")}</p> +</div> +</body> +</html> +</#if> \ No newline at end of file diff --git a/framework/resources/templates/error.jsp b/framework/resources/templates/error.jsp deleted file mode 100644 index adcf72b..0000000 --- a/framework/resources/templates/error.jsp +++ /dev/null @@ -1,53 +0,0 @@ -<%-- -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. ---%> - -<%@ page import="org.apache.ofbiz.base.util.*" %> -<html> -<head> -<title>OFBiz Message</title> -<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> -</head> - -<% String errorMsg = (String) request.getAttribute("_ERROR_MESSAGE_"); %> - -<body bgcolor="#FFFFFF"> -<div align="center"> - <br/> - <table width="100%" border="1" height="200"> - <tr> - <td> - <table width="100%" border="0" height="200"> - <tr bgcolor="#CC6666"> - <td height="45"> - <div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="4" color="#FFFFFF"><b>:ERROR MESSAGE:</b></font></div> - </td> - </tr> - <tr> - <td> - <div align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><%=UtilFormatOut.replaceString(errorMsg, "\n", "<br/>")%></font></div> - </td> - </tr> - </table> - </td> - </tr> - </table> -</div> -<div align="center"></div> -</body> -</html> \ No newline at end of file diff --git a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ControlServlet.java b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ControlServlet.java index 4656e64..29002ed 100644 --- a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ControlServlet.java +++ b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ControlServlet.java @@ -18,9 +18,12 @@ *******************************************************************************/ package org.apache.ofbiz.webapp.control; +import freemarker.template.Template; import java.io.IOException; import java.util.Enumeration; +import java.util.HashMap; +import java.util.Map; import javax.servlet.RequestDispatcher; import javax.servlet.ServletContext; import javax.servlet.ServletException; @@ -30,6 +33,7 @@ import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import org.apache.ofbiz.base.util.Debug; +import org.apache.ofbiz.base.util.StringUtil; import org.apache.ofbiz.base.util.UtilCodec; import org.apache.ofbiz.base.util.UtilGenerics; import org.apache.ofbiz.base.util.UtilHttp; @@ -224,9 +228,9 @@ public class ControlServlet extends HttpServlet { request.setAttribute("_ERROR_MESSAGE_", UtilCodec.getEncoder("html").encode(throwable.toString())); errorPage = handler.getDefaultErrorPage(request); } - } catch (RequestHandlerExceptionAllowExternalRequests e) { - errorPage = handler.getDefaultErrorPage(request); - Debug.logInfo("Going to external page: " + request.getPathInfo(), module); + } catch (RequestHandlerExceptionAllowExternalRequests e) { + errorPage = handler.getDefaultErrorPage(request); + Debug.logInfo("Going to external page: " + request.getPathInfo(), module); } catch (Exception e) { Debug.logError(e, "Error in request handler: ", module); request.setAttribute("_ERROR_MESSAGE_", UtilCodec.getEncoder("html").encode(e.toString())); @@ -240,41 +244,67 @@ public class ControlServlet extends HttpServlet { if (errorPage != null) { Debug.logError("An error occurred, going to the errorPage: " + errorPage, module); - RequestDispatcher rd = request.getRequestDispatcher(errorPage); - - // use this request parameter to avoid infinite looping on errors in the error page... - if (request.getAttribute("_ERROR_OCCURRED_") == null && rd != null) { - request.setAttribute("_ERROR_OCCURRED_", Boolean.TRUE); - Debug.logError("Including errorPage: " + errorPage, module); + Map<String, Object> context = new HashMap<>(); + context.put("request", request); + context.put("response", response); + context.put("session", session); + context.put("dispatcher", dispatcher); + context.put("delegator", delegator); + context.put("security", security); + context.put("locale", UtilHttp.getLocale(request)); + context.put("timeZone", UtilHttp.getTimeZone(request)); + context.put("userLogin", session.getAttribute("userLogin")); + context.put("visualTheme", UtilHttp.getVisualTheme(request)); + + boolean errorPageFailed = false; + if (errorPage.endsWith(".jsp")) { + RequestDispatcher rd = request.getRequestDispatcher(errorPage); + + // use this request parameter to avoid infinite looping on errors in the error page... + if (request.getAttribute("_ERROR_OCCURRED_") == null && rd != null) { + request.setAttribute("_ERROR_OCCURRED_", Boolean.TRUE); + Debug.logError("Including errorPage: " + errorPage, module); - // NOTE DEJ20070727 after having trouble with all of these, try to get the page out and as a last resort just send something back + try { + rd.include(request, response); + } catch (Throwable t) { + errorPageFailed = true; + } + } else { + if (rd == null) { + Debug.logError("Could not get RequestDispatcher for errorPage: " + errorPage, module); + } + errorPageFailed = true; + } + } else { try { - rd.include(request, response); + Template template = FreeMarkerWorker.getTemplate(errorPage); + FreeMarkerWorker.renderTemplate(template, context, response.getWriter()); + } catch (Exception e) { + errorPageFailed = true; + } + } + if (errorPageFailed) { + StringBuilder errorMessage = new StringBuilder("<html><body>") + .append("<h1>ERROR MESSAGE</h1>") + .append("<hr>").append("<p>") + .append("ERROR in error page, (infinite loop or error page not found with name ") + .append("[").append(errorPage).append("]").append("</p><p>") + .append("Original error detected, maybe it would be helps you : ") + .append(StringUtil.replaceString((String) request.getAttribute("_ERROR_MESSAGE_"), "\n", "<br>")) + .append("</p></body></html>"); + try { + response.getWriter().print(errorMessage.toString()); } catch (Throwable t) { - Debug.logWarning("Error while trying to send error page using rd.include (will try response.getOutputStream or response.getWriter): " + t.toString(), module); - - String errorMessage = "ERROR rendering error page [" + errorPage + "], but here is the error text: " + request.getAttribute("_ERROR_MESSAGE_"); try { - response.getWriter().print(errorMessage); + int errorToSend = HttpServletResponse.SC_INTERNAL_SERVER_ERROR; + Debug.logWarning("Error while trying to write error message using response.getOutputStream or response.getWriter, sending error code [" + errorToSend + "], and message [" + errorMessage + "]", module); + response.sendError(errorToSend, errorMessage.toString()); } catch (Throwable t2) { - try { - int errorToSend = HttpServletResponse.SC_INTERNAL_SERVER_ERROR; - Debug.logWarning("Error while trying to write error message using response.getOutputStream or response.getWriter: " + t.toString() + "; sending error code [" + errorToSend + "], and message [" + errorMessage + "]", module); - response.sendError(errorToSend, errorMessage); - } catch (Throwable t3) { - // wow, still bad... just throw an IllegalStateException with the message and let the servlet container handle it - throw new IllegalStateException(errorMessage); - } + // wow, still bad... just throw an IllegalStateException with the message and let the servlet container handle it + throw new IllegalStateException(errorMessage.toString()); } } - - } else { - if (rd == null) { - Debug.logError("Could not get RequestDispatcher for errorPage: " + errorPage, module); - } - - String errorMessage = "<html><body>ERROR in error page, (infinite loop or error page not found with name [" + errorPage + "]), but here is the text just in case it helps you: " + request.getAttribute("_ERROR_MESSAGE_") + "</body></html>"; - response.getWriter().print(errorMessage); } } diff --git a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/RequestHandler.java b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/RequestHandler.java index 618189b..3991bcb 100644 --- a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/RequestHandler.java +++ b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/RequestHandler.java @@ -18,6 +18,8 @@ *******************************************************************************/ package org.apache.ofbiz.webapp.control; +import java.net.MalformedURLException; +import org.apache.ofbiz.base.location.FlexibleLocation; import static org.apache.ofbiz.base.util.UtilGenerics.checkMap; import java.io.IOException; @@ -802,14 +804,17 @@ public class RequestHandler { /** Returns the default error page for this request. */ public String getDefaultErrorPage(HttpServletRequest request) { - String errorpage = null; + URL errorPage = null; try { - errorpage = getControllerConfig().getErrorpage(); - } catch (WebAppConfigurationException e) { + String errorPageLocation = getControllerConfig().getErrorpage(); + errorPage = FlexibleLocation.resolveLocation(errorPageLocation); + } catch (WebAppConfigurationException | MalformedURLException e) { Debug.logError(e, "Exception thrown while parsing controller.xml file: ", module); } - if (UtilValidate.isNotEmpty(errorpage)) return errorpage; - return "/error/error.jsp"; + if (errorPage == null) { + return "/error/error.jsp"; + } + return errorPage.toString(); } /** Returns the default status-code for this request. */ diff --git a/framework/webtools/webapp/webtools/error/error.jsp b/framework/webtools/webapp/webtools/error/error.jsp deleted file mode 100644 index 5f4de01..0000000 --- a/framework/webtools/webapp/webtools/error/error.jsp +++ /dev/null @@ -1,52 +0,0 @@ -<%-- -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. ---%> -<%@ page import="org.apache.ofbiz.base.util.*" %> -<html> -<head> -<title>OFBiz Message</title> -<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> -</head> - -<% String errorMsg = (String) request.getAttribute("_ERROR_MESSAGE_"); %> - -<body bgcolor="#FFFFFF"> -<div align="center"> - <br/> - <table width="100%" border="1" height="200"> - <tr> - <td> - <table width="100%" border="0" height="200"> - <tr bgcolor="#CC6666"> - <td height="45"> - <div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="4" color="#FFFFFF"><b>:ERROR MESSAGE:</b></font></div> - </td> - </tr> - <tr> - <td> - <div align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><%=UtilFormatOut.replaceString(errorMsg, "\n", "<br/>")%></font></div> - </td> - </tr> - </table> - </td> - </tr> - </table> -</div> -<div align="center"></div> -</body> -</html> diff --git a/framework/widget/dtd/widget-theme.xsd b/framework/widget/dtd/widget-theme.xsd index 5ddabbc..40fd549 100644 --- a/framework/widget/dtd/widget-theme.xsd +++ b/framework/widget/dtd/widget-theme.xsd @@ -152,7 +152,7 @@ under the License. <xs:element name="template"> <xs:complexType> <xs:sequence> - <xs:element minOccurs="1" maxOccurs="4" ref="template-file" /> + <xs:element minOccurs="1" maxOccurs="5" ref="template-file" /> </xs:sequence> <xs:attribute type="xs:string" name="name" use="required" /> <xs:attribute type="xs:string" name="type" use="required"/> @@ -171,6 +171,7 @@ under the License. <xs:enumeration value="form" /> <xs:enumeration value="tree" /> <xs:enumeration value="menu" /> + <xs:enumeration value="error" /> </xs:restriction> </xs:simpleType> </xs:attribute> diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelTheme.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelTheme.java index 1b1b556..8281b9b 100644 --- a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelTheme.java +++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelTheme.java @@ -390,6 +390,13 @@ public class ModelTheme implements Serializable { } return null; } + public String getErrorTemplateLocation(String name) { + ModelTemplate modelTemplate = modelTemplateMap.get(name); + if (modelTemplate != null) { + return modelTemplate.getErrorTemplateLocation(); + } + return null; + } public Map<String,String> getModelCommonScreens() { return modelCommonScreensMap; @@ -410,6 +417,7 @@ public class ModelTheme implements Serializable { private final String formRendererLocation; private final String menuRendererLocation; private final String treeRendererLocation; + private final String errorTemplateLocation; /** * Constructor to initialize a ModelTemplate class from xml definition @@ -427,6 +435,7 @@ public class ModelTheme implements Serializable { String formRendererLocation = null; String menuRendererLocation = null; String treeRendererLocation = null; + String errorTemplateLocation = null; for (Element templateFile : UtilXml.childElementList(template)) { switch (templateFile.getAttribute("widget")) { case "screen": @@ -441,12 +450,16 @@ public class ModelTheme implements Serializable { case "menu": menuRendererLocation = templateFile.getAttribute("location"); break; + case "error": + errorTemplateLocation = templateFile.getAttribute("location"); + break; } } this.screenRendererLocation = screenRendererLocation; this.formRendererLocation = formRendererLocation; this.menuRendererLocation = menuRendererLocation; this.treeRendererLocation = treeRendererLocation; + this.errorTemplateLocation = errorTemplateLocation; } /** @@ -466,6 +479,7 @@ public class ModelTheme implements Serializable { this.formRendererLocation = exist && currentModelTemplate.formRendererLocation != null ? currentModelTemplate.formRendererLocation : originModelTemplate.formRendererLocation; this.treeRendererLocation = exist && currentModelTemplate.treeRendererLocation != null ? currentModelTemplate.treeRendererLocation : originModelTemplate.treeRendererLocation; this.menuRendererLocation = exist && currentModelTemplate.menuRendererLocation != null ? currentModelTemplate.menuRendererLocation : originModelTemplate.menuRendererLocation; + this.errorTemplateLocation = exist && currentModelTemplate.errorTemplateLocation != null ? currentModelTemplate.errorTemplateLocation : originModelTemplate.errorTemplateLocation; } public String getEncoder() { return encoder; @@ -493,5 +507,8 @@ public class ModelTheme implements Serializable { public String getMenuRendererLocation() { return menuRendererLocation; } + public String getErrorTemplateLocation() { + return errorTemplateLocation; + } } } diff --git a/themes/common-theme/template/ErrorPage.ftl b/themes/common-theme/template/ErrorPage.ftl new file mode 100644 index 0000000..3e20390 --- /dev/null +++ b/themes/common-theme/template/ErrorPage.ftl @@ -0,0 +1,509 @@ +<#-- +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. +--> +<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> +<html> +<head> + <title>500 Internal error</title> + <style> + body{ + display: flex; + justify-content: center; + align-items: center; + font-family: Helvetica,Arial,sans-serif; + color:#6d6e71; + position:relative; + background: #f6e9f0; + margin:0; + min-height:100vh; + background: -moz-linear-gradient(-45deg, #f6e9f0 0%, #fdebeb 100%); + background: -webkit-linear-gradient(-45deg, #f6e9f0 0%,#fdebeb 100%); + background: linear-gradient(135deg, #f6e9f0 0%,#fdebeb 100%); + } + .container{ + position:relative; + text-align:center; + } + .ofbiz{ + margin:40px 0; + } + .content{ + width:auto; + max-width:1000px; + margin-top:60px; + border-radius:5px; + background:#FFFFFF; + padding:50px 100px 30px 100px; + text-align:center; + display: flex; + flex-direction: column; + position:relative; + z-index:2; + -webkit-box-shadow: 0px 0px 18px 0px rgba(159,32,100,0.11); + -moz-box-shadow: 0px 0px 18px 0px rgba(159,32,100,0.11); + box-shadow: 0px 0px 18px 0px rgba(159,32,100,0.11); + } + .content p.error-500{ + font-size:28px; + letter-spacing:2px; + font-weight:normal; + color:#d22128; + } + .content p.error-500 span{ + display:block; + letter-spacing:3px; + color:#6d6e71; + margin:0 0 10px 8px; + } + .content p.error-500 strong{ + font-size:150px; + line-height:120px; + font-weight:normal; + } + .content h1{ + font-size:28px; + color:#6d6e71; + letter-spacing:3px; + font-weight:normal; + text-transform: uppercase; + margin:0 0 5px 0; + } + .content p{ + font-size:15px; + text-align:justify; + max-width:380px; + margin:0 auto; + line-height:20px; + } + .content .img{ + max-width:380px; + margin:20px auto; + } + .top-right{ + position:absolute; + top:0; + right:0; + z-index:0; + } + .bottom-left{ + position:absolute; + bottom:0; + left:0; + z-index:0; + } + </style> +</head> +<body> +<div class="container"> + <div class="content"> + <p class="error-500"><span>ERROR MESSAGE</span></p> + <p>${request.getAttribute("_ERROR_MESSAGE_")?replace("\n", "<br/>")}</p> + <div class="img"> + <svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + id="svg3134" + version="1.1" + viewBox="0 0 101.20419 53.890289" + height="53.890289mm" + width="101.20419mm"> + <defs + id="defs3128"> + <linearGradient + gradientTransform="translate(0,100)" + gradientUnits="userSpaceOnUse" + y2="4596.5923" + x2="3089.7664" + y1="4633.2754" + x1="3295.5352" + id="linearGradient2973" + xlink:href="#linearGradient2971" /> + <linearGradient + id="linearGradient2971"> + <stop + id="stop2967" + offset="0" + style="stop-color:#d23332;stop-opacity:1" /> + <stop + id="stop2969" + offset="1" + style="stop-color:#a4205e;stop-opacity:1" /> + </linearGradient> + <linearGradient + gradientTransform="translate(0,100)" + gradientUnits="userSpaceOnUse" + y2="4503.186" + x2="3037.604" + y1="4616.728" + x1="3071.7537" + id="linearGradient2981" + xlink:href="#linearGradient2979" /> + <linearGradient + id="linearGradient2979"> + <stop + id="stop2975" + offset="0" + style="stop-color:#8f2470;stop-opacity:1" /> + <stop + id="stop2977" + offset="1" + style="stop-color:#282662;stop-opacity:1" /> + </linearGradient> + <linearGradient + gradientTransform="translate(0,100)" + gradientUnits="userSpaceOnUse" + y2="4639.0312" + x2="3313.1592" + y1="4558.6782" + x1="3318.1951" + id="linearGradient2965" + xlink:href="#linearGradient2963" /> + <linearGradient + id="linearGradient2963"> + <stop + id="stop2959" + offset="0" + style="stop-color:#e97826;stop-opacity:1" /> + <stop + id="stop2961" + offset="1" + style="stop-color:#d23232;stop-opacity:1" /> + </linearGradient> + <linearGradient + gradientTransform="translate(0,100)" + gradientUnits="userSpaceOnUse" + y2="4579.4399" + x2="3380.7964" + y1="4518.3018" + x1="3410.6697" + id="linearGradient2957" + xlink:href="#linearGradient2955" /> + <linearGradient + id="linearGradient2955"> + <stop + id="stop2951" + offset="0" + style="stop-color:#f18c24;stop-opacity:1" /> + <stop + id="stop2953" + offset="1" + style="stop-color:#f69923;stop-opacity:1" /> + </linearGradient> + </defs> + <metadata + id="metadata3131"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + transform="translate(-50.000687,-91.563468)" + id="layer1"> + <ellipse + style="opacity:0.93999999;vector-effect:none;fill:#e0e0e2;fill-opacity:1;stroke:none;stroke-width:5.88446999;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:markers stroke fill" + id="path2338" + cx="100.09739" + cy="144.49492" + rx="45.061985" + ry="0.95883906" /> + <g + id="g3007" + transform="matrix(0.26458333,0,0,0.26458333,-752.54101,-1126.3783)"> + <path + id="path2949" + d="m 3099.611,4677.0045 -24.8738,0.9885 -1.0458,47.8527 c 17.4472,29.1352 46.7055,35.8466 49.6055,36.2871 l 0.416,-0.027 c 0.8342,-0.057 44.8931,7.0033 97.6738,6.7656 1.9239,0.032 3.8829,0.02 5.8672,0.019 10.4557,-0.2921 20.9114,-0.5846 31.7559,-1.3222 l 8.7597,-0.5957 c 44.0415,-4.5557 71.6919,-13.8526 91.0043,-28.8876 l -66.3278,-34.0236 -2.8629,-10.3876 c 0,0 -2.1891,-9.2804 -1.315,-13.6891 0.045,-0.2266 -2.5622,2.646 -2.7241,2.8105 -1.0324,1.0494 -2.07 [...] + style="fill:url(#linearGradient2973);fill-opacity:1;stroke-width:4.18057013" /> + <path + id="path2939" + d="m 3039.457,4603.2461 c -1.7156,-0.059 -2.998,1.5601 -2.5488,3.2168 5.5069,21.5006 14.2349,40.2926 28.5684,57.5293 -1.8764,1.2006 -4.0328,1.7834 -6.502,-0.9375 -3.888,2.8901 -10.2147,3.4406 -17.0703,3.4785 5.618,2.6754 11.9512,3.2385 18.2656,1.127 -11.3013,18.5428 -15.5045,37.5612 -6.248,53.6699 0.8272,1.4378 1.7484,2.8489 2.7832,4.2265 -2.7685,-6.5328 -2.2158,-12.4448 3.2168,-21.1464 -1.3503,16.4797 0.6898,26.243 6.8847,37.2753 1.4655,2.6134 3.1699,5.31 [...] + style="fill:url(#linearGradient2981);fill-opacity:1;stroke-width:4.18057013" /> + <path + id="path2936" + d="m 3291.9932,4703.2276 13.663,41.8837 52.2442,-6.3711 c 14.7463,-11.4801 25.148,-26.6816 35.5156,-46.6738 1.2296,-2.3164 2.4489,-4.8154 3.5895,-7.0422 l -44.626,5.588 -18.3374,-58.9756 c -13.2982,10.3972 -24.4369,23.3098 -31.589,32.1993 -5.1853,6.574 -9.573,24.8439 -10.4599,39.3917 z" + style="fill:url(#linearGradient2965);fill-opacity:1;stroke-width:4.18057013" /> + <path + id="path22-4" + d="m 3333.8105,4631.791 18.4532,59.0528 44.5488,-5.4336 c 18.6958,-36.5015 25.347,-61.0535 11.6523,-70.7852 -20.7097,-14.9333 -50.1324,1.9932 -62.248,8.6836 -4.3339,2.4988 -8.4633,5.3997 -12.4063,8.4824 z" + style="fill:url(#linearGradient2957);fill-opacity:1;stroke-width:4.18057013" /> + <path + id="path22-4-6-0-9" + d="m 3364.2109,4664.6016 c -0.2907,1.1205 -3.7885,7.2979 -7.9199,16.5254 -4.1314,9.2274 -10.8379,21.2782 -21.3555,33.4414 -21.0267,24.3165 -57.1996,49.168 -119.1406,52.9843 -14.5823,0.1568 -29.7998,0.1712 -42.7884,-0.1998 l 1.2787,4.653 c 13.0252,0.3721 26.9095,0.6885 41.6171,0.5293 h 0.062 0.062 c 63.1986,-3.8754 100.8825,-29.5001 122.6758,-54.7031 10.8967,-12.6016 15.8356,-24.4605 20.1276,-34.0465 4.292,-9.586 5.9952,-17.1273 6.2025,-17.9262 z" + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#00 [...] + <path + id="path22-4-6-2" + d="m 3033.2285,4604.5879 c 6.1937,27.3012 16.9356,50.23 36.9317,71.0605 20.4864,25.5095 51.8053,52.0069 98.4281,74.601 3.9716,0.5927 3.8864,-0.1719 8.2281,-1.7435 -49.3956,-22.9249 -81.8746,-50.1342 -102.707,-76.086 l -0.072,-0.088 -0.08,-0.084 c -19.4679,-20.231 -29.8067,-42.2228 -35.818,-69 z" + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#00 [...] + <g + style="fill:#ffffff" + id="g24-3-7-5" + transform="matrix(4.1709335,-0.28368989,0.28368989,4.1709335,3011.7193,4498.5132)"> + <path + style="fill:none;stroke:#fffffc;stroke-width:1.06773412;stroke-opacity:1" + id="path22-4-6-0" + d="m 49.402494,57.232911 c -4.630827,2.873375 -14.382842,6.210532 -23.858254,7.141741 -1.934467,0.190113 -3.858435,0.283733 -5.726392,0.257987 l 0.108333,2.12e-4 v 0 0 0 0 0" /> + </g> + </g> + </g> + </svg> + </div> + </div> + <div class="ofbiz"> + <svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="107.3503" + height="37.045204" + viewBox="0 0 107.3503 37.045204" + version="1.1" + id="svg25" + sodipodi:docname="ApacheOFBiz.svg" + inkscape:version="0.92.3 (2405546, 2018-03-11)"> + <metadata + id="metadata29"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title>OFBiz-Logo</dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1920" + inkscape:window-height="1052" + id="namedview27" + showgrid="false" + fit-margin-top="0" + fit-margin-left="0" + fit-margin-right="0" + fit-margin-bottom="0" + inkscape:zoom="2.73178" + inkscape:cx="109.09782" + inkscape:cy="21.531926" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:window-maximized="1" + inkscape:current-layer="OFBiz-Logo" /> + <!-- Generator: Sketch 39.1 (31720) - http://www.bohemiancoding.com/sketch --> + <title + id="title2">OFBiz-Logo</title> + <desc + id="desc4">Created with Sketch.</desc> + <defs + id="defs17"> + <linearGradient + x1="323.64899" + y1="790.30109" + x2="380.14191" + y2="150.35954" + id="linearGradient-1" + gradientTransform="matrix(0.0908848,0,0,0.05788842,55.647944,584.97976)" + gradientUnits="userSpaceOnUse"> + <stop + stop-color="#282662" + offset="0%" + id="stop6" /> + <stop + stop-color="#792B81" + offset="25%" + id="stop8" /> + <stop + stop-color="#CB2039" + offset="50%" + id="stop10" /> + <stop + stop-color="#DB4F32" + offset="75%" + id="stop12" /> + <stop + stop-color="#F69A25" + offset="100%" + id="stop14" /> + </linearGradient> + </defs> + <g + id="Page-1" + style="fill:none;fill-rule:evenodd;stroke:none;stroke-width:1" + transform="translate(-59.999968,-593.68383)"> + <g + id="OFBiz-Logo"> + <path + d="m 146.60555,611.57045 c 0,-0.73136 0.22256,-1.28407 0.66768,-1.65816 0.44512,-0.37408 1.07531,-0.56112 1.89059,-0.56112 0.68408,0 1.20416,0.13029 1.56026,0.39089 0.3561,0.2606 0.53414,0.63468 0.53414,1.12226 0,0.67251 -0.20616,1.21682 -0.61848,1.63294 -0.41232,0.41612 -1.04954,0.62417 -1.91167,0.62417 -1.41502,0 -2.12252,-0.51699 -2.12252,-1.55098 z m 0.57513,15.97944 c -0.18419,0.77949 -0.98303,1.41139 -1.78366,1.41139 h -2.78084 l 2.99785,-12.68614 c 0.18 [...] + id="OFBiz" + inkscape:connector-curvature="0" + style="fill:#e05d30;stroke-width:0.07253397" /> + <path + d="m 91.744038,596.92224 c 11.061582,-3.07732 19.929752,-0.80612 20.507832,5.67841 0.16943,1.90339 -0.39233,3.9786 -1.54545,6.08864 l 5.47835,-3.5e-4 c 1.32032,-2.30425 2.12505,-4.96935 1.95316,-7.06827 -0.63202,-7.69411 -12.08283,-10.06842 -26.344795,-5.912 l 0.03869,-0.95665 c 0.03721,-0.99152 -1.489125,-1.29755 -3.413183,-0.68801 -1.921192,0.61374 -3.513574,1.91206 -3.55457,2.90204 l -0.04884,1.22501 c -14.560958,6.1213 -25.433697,16.74386 -24.787937,24.600 [...] + id="Bug" + style="fill:url(#linearGradient-1);stroke-width:0.07253397" + inkscape:connector-curvature="0" /> + <path + d="m 165.90055,614.86375 c 0.24354,0 0.48131,0.0625 0.71332,0.18746 0.23201,0.12498 0.41274,0.30379 0.5422,0.53644 0.12947,0.23264 0.1942,0.47522 0.1942,0.72774 0,0.24995 -0.0638,0.49029 -0.19131,0.72101 -0.12754,0.23073 -0.30635,0.40986 -0.53644,0.5374 -0.23008,0.12754 -0.47074,0.1913 -0.72197,0.1913 -0.25123,0 -0.49189,-0.0638 -0.72198,-0.1913 -0.23008,-0.12754 -0.40921,-0.30667 -0.53739,-0.5374 -0.12818,-0.23072 -0.19227,-0.47106 -0.19227,-0.72101 0,-0.2525 [...] + id="®" + inkscape:connector-curvature="0" + style="fill:#e05d30;stroke-width:0.07253397" /> + <path + d="m 120.0092,606.76652 -0.84524,1.91236 h -0.9192 l 3.39681,-7.57546 h 0.89806 l 3.38624,7.57546 h -0.94033 l -0.84524,-1.91236 z m 2.05499,-4.67522 -1.6852,3.84055 h 3.39681 z m 10.07683,-0.32225 c 0.51595,0.44375 0.77392,1.07063 0.77392,1.88065 0,0.8382 -0.25797,1.4871 -0.77392,1.94669 -0.51595,0.4596 -1.24232,0.6894 -2.17913,0.6894 h -1.98103 v 2.39309 h -0.86637 v -7.57546 h 2.8474 c 0.93681,0 1.66318,0.22187 2.17913,0.66563 z m -4.16016,3.68735 h 1.94933 [...] + id="APACHE" + inkscape:connector-curvature="0" + style="fill:#282662;stroke-width:0.07253397" /> + </g> + </g> + </svg> + </div> +</div> +<div class="top-right"> + <svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + id="svg4630" + version="1.1" + viewBox="0 0 103.89402 172.09494" + height="172.09494mm" + width="103.89402mm"> + <defs + id="defs4624"> + <linearGradient + gradientTransform="matrix(-0.26458333,0,0,-0.26458333,839.39308,1318.2247)" + gradientUnits="userSpaceOnUse" + y2="4933.9526" + x2="2718.0952" + y1="4404.6724" + x1="2390.8035" + id="linearGradient2470" + xlink:href="#linearGradient2963" /> + <linearGradient + id="linearGradient2963"> + <stop + id="stop2959" + offset="0" + style="stop-color:#e97826;stop-opacity:1" /> + <stop + id="stop2961" + offset="1" + style="stop-color:#d23232;stop-opacity:1" /> + </linearGradient> + </defs> + <metadata + id="metadata4627"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + transform="translate(-106.49747,0.6493372)" + id="layer1"> + <path + style="opacity:0.08900003;fill:url(#linearGradient2470);fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="m 106.49938,-0.6493372 103.65044,0.06699 c 0,0 0.24167,137.8763572 0.24167,172.0279572 C 194.14658,86.301976 106.02462,100.09249 106.49938,-0.6493372 Z" + id="path2462" /> + </g> + </svg> +</div> +<div class="bottom-left"> + <svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + id="svg4033" + version="1.1" + viewBox="0 0 91.812927 146.7365" + height="146.7365mm" + width="91.812927mm"> + <defs + id="defs4027"> + <linearGradient + gradientTransform="matrix(-0.26458333,0,0,-0.26458333,916.99951,1314.7743)" + gradientUnits="userSpaceOnUse" + y2="4298.6235" + x2="3464.0454" + y1="3842.3198" + x1="3123.0879" + id="linearGradient2460" + xlink:href="#linearGradient2979" /> + <linearGradient + id="linearGradient2979"> + <stop + id="stop2975" + offset="0" + style="stop-color:#8f2470;stop-opacity:1" /> + <stop + id="stop2977" + offset="1" + style="stop-color:#282662;stop-opacity:1" /> + </linearGradient> + </defs> + <metadata + id="metadata4030"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g transform="translate(0.7040734,-151.73208)" + id="layer1"> + <path style="opacity:0.125;fill:url(#linearGradient2460);fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="M -0.7040734,298.46858 V 151.73208 C 31.56287,239.33445 96.998351,202.92977 90.682481,298.16045 Z" + id="path2452" /> + </g> + </svg> +</div> +</body></html> \ No newline at end of file diff --git a/themes/common-theme/widget/Theme.xml b/themes/common-theme/widget/Theme.xml index c8ae429..e289532 100644 --- a/themes/common-theme/widget/Theme.xml +++ b/themes/common-theme/widget/Theme.xml @@ -93,6 +93,7 @@ under the License. <template-file widget="form" location="component://common-theme/template/macro/HtmlFormMacroLibrary.ftl"/> <template-file widget="tree" location="component://common-theme/template/macro/HtmlTreeMacroLibrary.ftl"/> <template-file widget="menu" location="component://common-theme/template/macro/HtmlMenuMacroLibrary.ftl"/> + <template-file widget="error" location="component://common-theme/template/ErrorPage.ftl"/> </template> <template name="screenxml" type="xml" content-type="UTF-8" encoding="none" encoder="xml"> <template-file widget="screen" location="component://common-theme/template/macro/XmlScreenMacroLibrary.ftl"/> |
Free forum by Nabble | Edit this page |