2 sinat 28978689 sinat_28978689 于 2016.09.13 19:44 提问

springmvc配置文件中*.do和*.html之间的区别

@RequestMapping(value="/returnTeacher")
@ResponseBody //web的配置url更改*.do 可以执行 设置为*.html不能执行406错误???
public Teacher returnTeacher(){
Teacher teacher = new Teacher();
teacher.setAge(24);
teacher.setName("wangfa");
System.out.println(teacher);
return teacher;
}


login
.do


login
.html

    为什么拦截*.html时,浏览器报错406
The resource identified by this request is only capable of generating responses with characteristics not acceptable according to the request "accept" headers.

而拦截*.do时,就能正常解析

1个回答

u013865953
u013865953   2016.09.13 20:37
Csdn user default icon
上传中...
上传图片
插入图片