|
|
@@ -1,5 +1,6 @@
|
|
|
package com.zheng.common.base;
|
|
|
|
|
|
+import com.zheng.common.util.PropertiesFileUtil;
|
|
|
import org.apache.shiro.authz.UnauthorizedException;
|
|
|
import org.apache.shiro.session.InvalidSessionException;
|
|
|
import org.slf4j.Logger;
|
|
|
@@ -8,6 +9,7 @@ import org.springframework.web.bind.annotation.ExceptionHandler;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
+import java.io.File;
|
|
|
|
|
|
/**
|
|
|
* 控制器基类
|
|
|
@@ -41,4 +43,23 @@ public abstract class BaseController {
|
|
|
return "/error.jsp";
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 返回jsp视图
|
|
|
+ * @param path
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public static String jsp(String path) {
|
|
|
+ return path + ".jsp";
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 返回thymeleaf视图
|
|
|
+ * @param path
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public static String thymeleaf(String path) {
|
|
|
+ String folder = PropertiesFileUtil.getInstance().get("app.name");
|
|
|
+ return File.separator.concat(folder).concat(path);
|
|
|
+ }
|
|
|
+
|
|
|
}
|