-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
QueryViewer was not working in GAM Backend homepage (#771)
* QueryViewer was not working in GAM Backend homepage Issue: 104713 * QueryViewer was not working in Java using SpringBoot Issue: 104713
- Loading branch information
Showing
4 changed files
with
60 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
gxspringboot/src/main/java/com/genexus/springboot/GXServletContextInitializer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.genexus.springboot; | ||
|
||
import jakarta.servlet.Servlet; | ||
import jakarta.servlet.ServletContext; | ||
import jakarta.servlet.ServletRegistration; | ||
import org.apache.logging.log4j.Logger; | ||
import org.springframework.boot.web.servlet.ServletContextInitializer; | ||
import org.springframework.core.io.ClassPathResource; | ||
|
||
public class GXServletContextInitializer implements ServletContextInitializer { | ||
private static Logger log = org.apache.logging.log4j.LogManager.getLogger(GXServletContextInitializer.class); | ||
|
||
@Override | ||
public void onStartup(ServletContext container) { | ||
try { | ||
//Add QueryViewer Servlets mappings | ||
if (new ClassPathResource("qviewer/services/agxpl_get.class").exists()) { | ||
ServletRegistration.Dynamic dispatcherQuery1 = container.addServlet("agxpl_get", (Servlet) Class.forName("qviewer.services.agxpl_get").getConstructor().newInstance()); | ||
dispatcherQuery1.addMapping("/qviewer.services.agxpl_get"); | ||
} | ||
|
||
if (new ClassPathResource("qviewer/services/agxpl_get_debug.class").exists()) { | ||
ServletRegistration.Dynamic dispatcherQuery2 = container.addServlet("agxpl_get_debug", (Servlet) Class.forName("qviewer.services.agxpl_get_debug").getConstructor().newInstance()); | ||
dispatcherQuery2.addMapping("/qviewer.services.agxpl_get_debug"); | ||
} | ||
|
||
if (new ClassPathResource("qviewer/services/gxqueryviewerforsd.class").exists()) { | ||
ServletRegistration.Dynamic dispatcherQuery3 = container.addServlet("gxqueryviewerforsd", (Servlet) Class.forName("qviewer.services.gxqueryviewerforsd").getConstructor().newInstance()); | ||
dispatcherQuery3.addMapping("/qviewer.services.gxqueryviewerforsd"); | ||
} | ||
} | ||
catch(Exception e) { | ||
log.error("Error executing ServletContextInitializer", e); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters