[ofbiz-plugins] branch trunk updated: Improved: User Error.ftl everywhere it's not yet used (OFBIZ-11890)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[ofbiz-plugins] branch trunk updated: Improved: User Error.ftl everywhere it's not yet used (OFBIZ-11890)

jleroux@apache.org
This is an automated email from the ASF dual-hosted git repository.

jleroux pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-plugins.git


The following commit(s) were added to refs/heads/trunk by this push:
     new a50442d  Improved: User Error.ftl everywhere it's not yet used (OFBIZ-11890)
a50442d is described below

commit a50442d1216b73402c27dbd9b588b9e4b5f8f691
Author: Jacques Le Roux <[hidden email]>
AuthorDate: Wed Jul 15 20:56:13 2020 +0200

    Improved: User Error.ftl everywhere it's not yet used (OFBIZ-11890)
   
    At https://markmail.org/message/n76cchtriexxmgm7 I asked
   
    Why having the ftl handlers only in webtools controller? BTW it makes the XSD
    documentation awkward because it speaks about the ftl handlers being in
    handlers-controller.xml
    Why not using error.ftl in common-controller.xml instead of error.jsp?
    Same question for plugins.
   
    And answered
   
    I believe we could change all that and definitely get rid of error.jsp
    (error.ftl is already in all supported releases branches)
---
 ecommerce/webapp/ecommerce/WEB-INF/controller.xml | 3 ++-
 webpos/webapp/webpos/WEB-INF/controller.xml       | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/ecommerce/webapp/ecommerce/WEB-INF/controller.xml b/ecommerce/webapp/ecommerce/WEB-INF/controller.xml
index 4266838..e887b22 100644
--- a/ecommerce/webapp/ecommerce/WEB-INF/controller.xml
+++ b/ecommerce/webapp/ecommerce/WEB-INF/controller.xml
@@ -36,6 +36,7 @@ under the License.
     <handler name="screen" type="view" class="org.apache.ofbiz.widget.renderer.macro.MacroScreenViewHandler"/>
     <handler name="simplecontent" type="view" class="org.apache.ofbiz.content.view.SimpleContentViewHandler"/>
     <handler name="screenfop" type="view" class="org.apache.ofbiz.widget.renderer.fo.ScreenFopViewHandler"/>
+    <handler name="ftl" type="view" class="org.apache.ofbiz.webapp.ftl.FreeMarkerViewHandler"/>
 
     <!-- Events run from here for the first hit in a visit -->
     <firstvisit>
@@ -1879,7 +1880,7 @@ under the License.
     <!-- End of Request Mappings -->
 
     <!-- View Mappings -->
-    <view-map name="error" page="/error/error.jsp"/>
+    <view-map name="error" type="ftl" page="component://common/webcommon/error/Error.ftl"/>
     <view-map name="main" type="screen" page="component://ecommerce/widget/CommonScreens.xml#main"/>
     <view-map name="policies" type="screen" page="component://ecommerce/widget/CommonScreens.xml#policies"/>
     <view-map name="CookiePolicy" type="screen" page="component://ecommerce/widget/CommonScreens.xml#CookiePolicy"/>
diff --git a/webpos/webapp/webpos/WEB-INF/controller.xml b/webpos/webapp/webpos/WEB-INF/controller.xml
index 38c1dc3..f40c9b4 100644
--- a/webpos/webapp/webpos/WEB-INF/controller.xml
+++ b/webpos/webapp/webpos/WEB-INF/controller.xml
@@ -29,6 +29,7 @@
     <handler name="groovy" type="request" class="org.apache.ofbiz.webapp.event.GroovyEventHandler"/>    
     <handler name="jsp" type="view" class="org.apache.ofbiz.webapp.view.JspViewHandler"/>
     <handler name="screen" type="view" class="org.apache.ofbiz.widget.renderer.macro.MacroScreenViewHandler"/>
+    <handler name="ftl" type="view" class="org.apache.ofbiz.webapp.ftl.FreeMarkerViewHandler"/>
     
     <!-- Events run from here for the first hit in a visit -->
     <firstvisit>
@@ -495,7 +496,7 @@
     </request-map>
     
     <!-- View Mappings -->
-    <view-map name="error" page="/error/error.jsp"/>
+    <view-map name="error" type="ftl" page="component://common/webcommon/error/Error.ftl"/>
     <view-map name="Error" type="screen" page="component://webpos/widget/WebPosScreens.xml#Main"/>
     <view-map name="main" type="screen" page="component://webpos/widget/WebPosScreens.xml#Main"/>
     <view-map name="login" type="screen" page="component://webpos/widget/CommonScreens.xml#Login"/>