帮看一下HttpServletRequest的问题!!!
//...
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参数的坑,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
java HttpServletRequest和HttpServletResponse详解
主要介绍了java HttpServletRequest和HttpServletResponse详解的相关资料,需要的朋友可以参考下
Java service层获取HttpServletRequest工具类的方法
今天小编就为大家分享一篇关于Java service层获取HttpServletRequest工具类的方法,小编觉得内容挺不错的,现在分享给大家,具有很好的参考价值,需要的朋友一起跟随小编来看看吧
[ 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()){
java通过HttpServletRequest获取post请求中的body内容的方法
本篇文章主要介绍了java通过HttpServletRequest获取post请求中的body内容的方法,具有一定的参考价值,感兴趣的小伙伴们可以参考一下


Web 开发
