首页>代码>基于jsp+servlet的idea版学生管理系统,前端框架layui>/studentManage/源码/studentManage/src/main/java/controller/BaseServlet.java
package controller;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.lang.reflect.Method;
@WebServlet(name = "BaseServlet")
public class BaseServlet extends HttpServlet {
@Override
protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
req.setCharacterEncoding("UTF-8");
resp.setCharacterEncoding("UTF-8");
String method = req.getParameter("method");
if (method != null) {
try {
Method targetMethod = this.getClass().getMethod(method, HttpServletRequest.class, HttpServletResponse.class);
targetMethod.invoke(this, req, resp);
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
最近下载更多
1271247100 LV9
11月21日
ZzzxzzZ LV6
4月12日
zhaipengfei LV2
3月3日
ma406805131 LV19
2024年12月27日
120_wu LV4
2024年12月2日
李清清 LV2
2024年11月6日
xiao小果 LV13
2024年8月19日
破剑茶寮 LV4
2024年6月26日
15719908287 LV10
2024年6月19日
TY0165 LV20
2024年6月18日
最近浏览更多
xiongguatiao
11月30日
暂无贡献等级
1271247100 LV9
11月21日
李玟龙 LV2
6月16日
ZzzxzzZ LV6
4月12日
zhaipengfei LV2
3月3日
暂无贡献等级
kkkxyh LV13
2月11日
dongandmin LV9
2024年12月27日
ma406805131 LV19
2024年12月26日
120_wu LV4
2024年12月2日

