1.获取到的值为" "空字符串 

当url里有name属性,但是没有值的时候后台用request.getParameter("name")获取的是空字符串""

 

2.获取到的值为null

 

当url里没有name属性,request.getParameter("name")获取的值是null

 

所以要考虑两种情况!

 

转载自:https://blog.csdn.net/caishancai/article/details/55104053

相关文章: