All Downloads are FREE. Search and download functionalities are using the official Maven repository.

kim.sesame.framework.web.controller.PageController Maven / Gradle / Ivy

package kim.sesame.framework.web.controller;

import kim.sesame.framework.web.annotation.IgnoreLoginCheck;
import kim.sesame.framework.web.config.WebProperties;
import lombok.extern.apachecommons.CommonsLog;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * 所有的页面加载
 */
@CommonsLog
@Controller
@RequestMapping("/page")
public class PageController {

    @Resource
    private WebProperties webProperties;

    /**
     * 加载界面
     */
    @IgnoreLoginCheck
    @RequestMapping("/{uriPath}")
    public String index(@PathVariable("uriPath") String uriPath, HttpServletRequest request, ModelMap modelMap) {
        Map mm = request.getParameterMap();
        for (String s : mm.keySet()) {
            modelMap.put(s, request.getParameter(s));
        }
        uriPath = uriPath.replaceAll(webProperties.getPageReplace(), "/");
        return uriPath;
    }

    @IgnoreLoginCheck
    @RequestMapping("/error")
    public String page404(String e, ModelMap modelMap) {
        modelMap.put("e", e);
        return "error";
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy