|
@@ -1,5 +1,5 @@
|
|
|
/*
|
|
|
- * Copyright [2020] [MaxKey of copyright http://www.maxkey.top]
|
|
|
+ * Copyright [2022] [MaxKey of copyright http://www.maxkey.top]
|
|
|
*
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
* you may not use this file except in compliance with the License.
|
|
@@ -17,19 +17,9 @@
|
|
|
|
|
|
package org.maxkey.web.contorller;
|
|
|
|
|
|
-import java.io.IOException;
|
|
|
-
|
|
|
-import javax.servlet.ServletException;
|
|
|
-import javax.servlet.http.HttpServletRequest;
|
|
|
-import javax.servlet.http.HttpServletResponse;
|
|
|
-
|
|
|
-import org.maxkey.configuration.ApplicationConfig;
|
|
|
-import org.maxkey.entity.Institutions;
|
|
|
-import org.maxkey.web.WebConstants;
|
|
|
import org.maxkey.web.WebContext;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
@@ -42,35 +32,12 @@ import org.springframework.web.servlet.ModelAndView;
|
|
|
@Controller
|
|
|
public class IndexEndpoint {
|
|
|
private static Logger _logger = LoggerFactory.getLogger(IndexEndpoint.class);
|
|
|
-
|
|
|
- @Autowired
|
|
|
- ApplicationConfig applicationConfig;
|
|
|
-
|
|
|
- @RequestMapping(value={"/forwardindex"})
|
|
|
- public ModelAndView forwardindex(HttpServletRequest request,
|
|
|
- HttpServletResponse response) throws ServletException, IOException {
|
|
|
- _logger.debug("IndexEndpoint /forwardindex.");
|
|
|
- Institutions inst = (Institutions)WebContext.getAttribute(WebConstants.CURRENT_INST);
|
|
|
- String defaultUri = inst.getDefaultUri();
|
|
|
- if (defaultUri != null && !defaultUri.equals("")) {
|
|
|
- _logger.debug("defaultUri " + defaultUri);
|
|
|
- return WebContext.redirect(defaultUri);
|
|
|
- }
|
|
|
- _logger.debug("Uri /appList");
|
|
|
- return new ModelAndView("/appList");
|
|
|
- }
|
|
|
-
|
|
|
- @RequestMapping(value={"/index"})
|
|
|
- public ModelAndView home(HttpServletRequest request,
|
|
|
- HttpServletResponse response) throws ServletException, IOException {
|
|
|
- _logger.debug("home /index.");
|
|
|
- return new ModelAndView("index");
|
|
|
- }
|
|
|
-
|
|
|
+
|
|
|
@RequestMapping(value={"/"})
|
|
|
public ModelAndView index() {
|
|
|
_logger.debug("IndexEndpoint /.");
|
|
|
- return new ModelAndView("index");
|
|
|
+ return new ModelAndView("index")
|
|
|
+ .addObject("appVersion", WebContext.properties.getProperty("application.formatted-version"));
|
|
|
|
|
|
}
|
|
|
|