帮看一下HttpServletRequest的问题!!!

qabp qabp 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
public class DepartmentManager {
//...
public void viewByNO(HttpServletRequest request,HttpServletResponse response)
throws ServletException, IOException{
try{
String depno=request.getParameter("depno");
if (depno==null) request.setAttribute("msg","null!");
else request.setAttribute("msg",depno);
//DepartmentMap dm=new DepartmentMap();
//Department dep=dm.load(depno);
//request.setAttribute("dep",dep);
}catch(Exception e){

}
}
//...
}

public class DepAndDutyServlet extends HttpServlet {
//..
protected void processRequest(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
depMan.viewByNO(request,response);
}

public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
processRequest(request,response);
}

public void doPost(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
processRequest(request,response);
}
//..
}

depno的值传不给DepartmentManager,怎么回事呀?
...全文

相关推荐

详解Spring框架下向异步线程传递HttpServletRequest参数的坑

主要介绍了详解Spring框架下向异步线程传递HttpServletRequest参数的坑,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧

weixin_38684335

java HttpServletRequest和HttpServletResponse详解

主要介绍了java HttpServletRequest和HttpServletResponse详解的相关资料,需要的朋友可以参考下

weixin_38640794

Java service层获取HttpServletRequest工具类的方法

今天小编就为大家分享一篇关于Java service层获取HttpServletRequest工具类的方法,小编觉得内容挺不错的,现在分享给大家,具有很好的参考价值,需要的朋友一起跟随小编来看看吧

weixin_38694299

[ vue ] axios 发送 POST 请求,后端不能通过 HttpServletRequest 获取参数

文章目录项目环境部分实现代码遇到的问题解决方案说明 项目环境 SpringBoot 1.5 Shiro 权限管理 vue / axios 部分实现代码 public Result admLogin(HttpServletRequest request, HttpServletResponse response, String username, String password){ log.info(用户名:{},密码:{},username,password); if(username.isEmpty() || password.isEmpty()){

weixin_38731123

java通过HttpServletRequest获取post请求中的body内容的方法

本篇文章主要介绍了java通过HttpServletRequest获取post请求中的body内容的方法,具有一定的参考价值,感兴趣的小伙伴们可以参考一下

weixin_38645208
评论 18
收藏 已收藏
分享
返回顶部
qabp
Web 开发 81,108 成员 341,721 内容