class Index {

    @RequestMapping("/appInfo")
    @ResponseBody
    public static String appInfo(HttpServletRequest request) {<FILL_FUNCTION_BODY>}

    @RequestMapping("/")
    public String redirect() {
        return "redirect:/index";
    }

    @RequestMapping("/index")
    public static String index(Model model, HttpServletRequest request) {
        String username = request.getUserPrincipal().getName();
        model.addAttribute("user", username);
        return "index";
    }
}

        String username = request.getUserPrincipal().getName();
        Map<String, String> m = new HashMap<>();

        m.put("tomcat_version", ServerInfo.getServerInfo());
        m.put("username", username);
        m.put("login", "success");
        m.put("app_name", "java security code");
        m.put("java_version", System.getProperty("java.version"));
        m.put("fastjson_version", JSON.VERSION);

        // covert map to string
        return JSON.toJSONString(m);
    
<no_super_class>