(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
# Conflicts:
# framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ControlServlet.java
# themes/common/template/ErrorPage.ftl
42 lines
1.5 KiB
Plaintext
42 lines
1.5 KiB
Plaintext
<#--
|
|
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> |