ajax请求信息 servlet没接收到

qq_28573739 qq_28573739 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
$.ajax({
type:"get",//请求方式
url:"S12",//发送请求地址
data:'{username:"ssd"}',
//请求成功后的回调函数有两个参数
success:function(data,textStatus){
alert(data);
}
});
后台
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
request.setCharacterEncoding("UTF-8");
PrintWriter out = response.getWriter();
String s = request.getParameter("username");
System.out.println(s);
out.println(s);
后台request没取到username的值,为什么?
...全文

相关推荐

评论 7
收藏 已收藏
分享
返回顶部
qq_28573739
Web 开发 81,107 成员 341,720 内容