From f6be23ee4bd65741766fb85787778bcef45d2e9b Mon Sep 17 00:00:00 2001 From: Ziver Koc Date: Thu, 3 Aug 2017 11:06:30 +0200 Subject: [PATCH] updated context.xml and added check if it has been updated --- WebContent/META-INF/context.example.xml | 26 ------------------------- WebContent/META-INF/context.xml | 23 ++++++++++++++++++++++ src/zall/Zallery.java | 4 ++++ 3 files changed, 27 insertions(+), 26 deletions(-) delete mode 100755 WebContent/META-INF/context.example.xml create mode 100755 WebContent/META-INF/context.xml diff --git a/WebContent/META-INF/context.example.xml b/WebContent/META-INF/context.example.xml deleted file mode 100755 index 021a9cf..0000000 --- a/WebContent/META-INF/context.example.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - WEB-INF/web.xml - - - - - - - - - \ No newline at end of file diff --git a/WebContent/META-INF/context.xml b/WebContent/META-INF/context.xml new file mode 100755 index 0000000..738b6dc --- /dev/null +++ b/WebContent/META-INF/context.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/src/zall/Zallery.java b/src/zall/Zallery.java index d9416ee..9c366ef 100755 --- a/src/zall/Zallery.java +++ b/src/zall/Zallery.java @@ -51,6 +51,10 @@ public class Zallery extends HttpServlet{ ROOT_PATH = config.getServletContext().getRealPath("/"); try { Context context = new InitialContext(); + // Check if Zallery has been properly configured + if ("C:\\\\data".equals(context.lookup("java:comp/env/DATA_PATH"))) + throw new ServletException("Zallery has not been properly configured, set proper configuration in Zaller.xml context file."); + WEBSITE_NAME = (String)context.lookup("java:comp/env/WEBSITE_NAME"); WEBSITE_URL = (String)context.lookup("java:comp/env/WEBSITE_URL"); if( WEBSITE_URL.charAt(WEBSITE_URL.length()-1) != '/')