[mapguide-commits] r9941 - sandbox/jng/vanilla_swig/Web/src/mapviewerjava

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Mon May 23 06:10:18 PDT 2022


Author: jng
Date: 2022-05-23 06:10:18 -0700 (Mon, 23 May 2022)
New Revision: 9941

Modified:
   sandbox/jng/vanilla_swig/Web/src/mapviewerjava/common.jsp
   sandbox/jng/vanilla_swig/Web/src/mapviewerjava/init.jsp
   sandbox/jng/vanilla_swig/Web/src/mapviewerjava/mainframe.jsp
Log:
First round of AJAX viewer fixes for Java:
 - Remove references to MapGuideJavaApiEx 
 - Fix MgInitializeWebTier calls as the binding now respects camelCase Java naming conventions
 - Remove catch blocks that caught for specific subclasses of MgException. Use the new getExceptionCode() API to test for and handle specific exception types

Modified: sandbox/jng/vanilla_swig/Web/src/mapviewerjava/common.jsp
===================================================================
--- sandbox/jng/vanilla_swig/Web/src/mapviewerjava/common.jsp	2022-05-23 12:37:08 UTC (rev 9940)
+++ sandbox/jng/vanilla_swig/Web/src/mapviewerjava/common.jsp	2022-05-23 13:10:18 UTC (rev 9941)
@@ -32,7 +32,7 @@
     //
     String realpath = getServletContext().getRealPath("/");
     String configPath =  realpath + "webconfig.ini";
-    MapGuideJavaApiEx.MgInitializeWebTier(configPath);
+    MapGuideJavaApi.mgInitializeWebTier(configPath);
 }
 
 String GetDefaultLocale()

Modified: sandbox/jng/vanilla_swig/Web/src/mapviewerjava/init.jsp
===================================================================
--- sandbox/jng/vanilla_swig/Web/src/mapviewerjava/init.jsp	2022-05-23 12:37:08 UTC (rev 9940)
+++ sandbox/jng/vanilla_swig/Web/src/mapviewerjava/init.jsp	2022-05-23 13:10:18 UTC (rev 9941)
@@ -24,7 +24,7 @@
     // Initialize web tier with the site configuration file.  The config
     // file should be in the same folder as this script.
     String configPath =  realpath + "webconfig.ini";
-    MapGuideJavaApiEx.MgInitializeWebTier( configPath );
+    MapGuideJavaApi.mgInitializeWebTier( configPath );
 }
 
 %>

Modified: sandbox/jng/vanilla_swig/Web/src/mapviewerjava/mainframe.jsp
===================================================================
--- sandbox/jng/vanilla_swig/Web/src/mapviewerjava/mainframe.jsp	2022-05-23 12:37:08 UTC (rev 9940)
+++ sandbox/jng/vanilla_swig/Web/src/mapviewerjava/mainframe.jsp	2022-05-23 13:10:18 UTC (rev 9941)
@@ -549,23 +549,15 @@
     response.getWriter().write(templ);
     response.setContentLength(templ.length());
 }
-catch(MgUserNotFoundException e)
-{
-    RequestAuthentication(response);
-    return;
-}
-catch(MgUnauthorizedAccessException e)
-{
-    RequestAuthentication(response);
-    return;
-}
-catch(MgAuthenticationFailedException e)
-{
-    RequestAuthentication(response);
-    return;
-}
 catch(MgException e)
 {
+    if (e.getExceptionCode() == MgExceptionCodes.MgUserNotFoundException ||
+        e.getExceptionCode() == MgExceptionCodes.MgUnauthorizedAccessException ||
+        e.getExceptionCode() == MgExceptionCodes.MgAuthenticationFailedException) {
+        RequestAuthentication(response);
+        return;
+    }
+
     String msg = EscapeForHtml(e.getExceptionMessage());
     response.getWriter().write(msg);
     response.setContentLength(msg.length());



More information about the mapguide-commits mailing list