在spring mvc 中 提交表单报错400 求大神帮忙!!

隽永I 2016-09-14 09:44:46
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
<!--
body {
margin-left: 3px;
margin-top: 0px;
margin-right: 3px;
margin-bottom: 0px;
}
.STYLE1 {
color: #e1e2e3;
font-size: 12px;
}
.STYLE6 {color: #000000; font-size: 12; }
.STYLE10 {color: #000000; font-size: 12px; }
.STYLE19 {
color: #344b50;
font-size: 12px;
}
.STYLE21 {
font-size: 12px;
color: #3b6375;
}
.STYLE22 {
font-size: 12px;
color: #295568;
}
-->
</style>
</head>

<body width="400">
<!-- 近10天内过生日客户 -->
<form action="addCus.html">
<table>

<tr>
<td>姓名:</td>
<td><input name="name"/></td>
</tr>

<tr>
<td>身份证:</td>
<td><input name="card"/></td>
</tr>

<tr>
<td>性别:</td>
<td><input name="sex"/></td>
</tr>

<tr>
<td>出生年月:</td>
<td><input name="birthday"/></td>
</tr>

<tr>
<td>民族:</td>
<td><input name="nation"/></td>
</tr>

<tr>
<td>婚姻:</td>
<td><input name="marriage"/></td>
</tr>

<tr>
<td>血型:</td>
<td><input name="bloodtype"/></td>
</tr>

<tr>
<td>职业:</td>
<td><input name="job"/></td>
</tr>

<tr>
<td>文化程度:</td>
<td><input name="education"/></td>
</tr>

<tr>
<td>信仰:</td>
<td><input name="belief"/></td>
</tr>

<tr>
<td>联系电话:</td>
<td><input name="phone"/></td>
</tr>

<tr>
<td>紧急联系电话:</td>
<td><input name="emergencycall"/></td>
</tr>

<tr>
<td>家庭住址:</td>
<td><input name="addr"/></td>
</tr>

<tr>
<td>主治医生:</td>
<td><input name="doctor"/></td>
</tr>

<tr>
<td colspan="2"><input type="submit"/></td>
</tr>
</table>
</form>

</body>
</html>











...全文
923 20 打赏 收藏 转发到动态 举报
写回复
用AI写文章
20 条回复
切换为时间正序
请发表友善的回复…
发表回复
qq_41800967 2019-10-17
  • 打赏
  • 举报
回复
@ResponseBody
隽永I 2017-04-20
  • 打赏
  • 举报
回复
引用 17 楼 DamonDown 的回复:
楼上一群说人家action写错的 万一人家的web.xml里面拦截的就是*.html呢 真的是呵呵了
qq_27350423 2017-03-28
  • 打赏
  • 举报
回复
提交地址都不对,肯定404啊
DamonDown 2017-03-24
  • 打赏
  • 举报
回复
楼上一群说人家action写错的 万一人家的web.xml里面拦截的就是*.html呢 真的是呵呵了
Swen程序员 2016-09-21
  • 打赏
  • 举报
回复
400错误,是你提交的参数与实体类无法匹配才导致的。 推荐看看:http://blog.csdn.net/a3025056/article/details/52598482
恒啊 2016-09-21
  • 打赏
  • 举报
回复
有你这样写form的action路径吗?你这是直接的一个跳转页面,和你的保存操作毫无关系!
wangzhuoyan 2016-09-19
  • 打赏
  • 举报
回复
400,应该是参数在匹配转换时报的异常,查查特殊参数就行
___d 2016-09-19
  • 打赏
  • 举报
回复
5楼正解 action里去掉.html 应该跟action里的方法注解上的requestMapping 对应上
toitorse2 2016-09-19
  • 打赏
  • 举报
回复
没被扫描到,或者未配置视图解析器
  • 打赏
  • 举报
回复
这个是应为你拦截器设置问题吧,你想要拦截html后缀的请求,检查你的web.xml应该能解决 ,要采纳啊
bluemouse2008 2016-09-19
  • 打赏
  • 举报
回复
form的提交地址错误, 改成action=“addCus/”试试
qq_21873571 2016-09-18
  • 打赏
  • 举报
回复
参数错误,本来应该是int的你传成String了
tony4geek 2016-09-18
  • 打赏
  • 举报
回复
400 看看参数少了,或者参数写错了。检查看看
技术控_ 2016-09-18
  • 打赏
  • 举报
回复
楼上正解,听他的没错,日,还要10个字
遥远的想念 2016-09-18
  • 打赏
  • 举报
回复
同意楼上 你的请求地址就是错的。。。应该是 action=“addCus”
ThinkingLJ 2016-09-18
  • 打赏
  • 举报
回复
from标签,提交的地址不对吧
血舞齐天 2016-09-18
  • 打赏
  • 举报
回复
from标签那,action=“addCus”,把后缀html去掉,试试
royluo2003 2016-09-15
  • 打赏
  • 举报
回复
400是参数有问题 看看是不是数字类型的参数传了字符串格式的
anlongyan 2016-09-14
  • 打赏
  • 举报
回复
400的错误应该是web.xml配置文件错误了。你看看
隽永I 2016-09-14
  • 打赏
  • 举报
回复
package org.four.crm.pojo; public class CusbasicInfo { private int id; private String name; private String card; private String sex; private String birthday; private String nation; private String marriage; private String bloodtype; private String job; private String education; private String belief; private String phone; private String emergencycall; private String addr; private int doctor; private int hid; public int getId() { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getCard() { return card; } public void setCard(String card) { this.card = card; } public String getSex() { return sex; } public void setSex(String sex) { this.sex = sex; } public String getBirthday() { return birthday; } public void setBirthday(String birthday) { this.birthday = birthday; } public String getNation() { return nation; } public void setNation(String nation) { this.nation = nation; } public String getMarriage() { return marriage; } public void setMarriage(String marriage) { this.marriage = marriage; } public String getBloodtype() { return bloodtype; } public void setBloodtype(String bloodtype) { this.bloodtype = bloodtype; } public String getJob() { return job; } public void setJob(String job) { this.job = job; } public String getEducation() { return education; } public void setEducation(String education) { this.education = education; } public String getBelief() { return belief; } public void setBelief(String belief) { this.belief = belief; } public String getPhone() { return phone; } public void setPhone(String phone) { this.phone = phone; } public String getEmergencycall() { return emergencycall; } public void setEmergencycall(String emergencycall) { this.emergencycall = emergencycall; } public String getAddr() { return addr; } public void setAddr(String addr) { this.addr = addr; } public int getDoctor() { return doctor; } public void setDoctor(int doctor) { this.doctor = doctor; } public int getHid() { return hid; } public void setHid(int hid) { this.hid = hid; } public CusbasicInfo(int id, String name, String card, String sex, String birthday, String nation, String marriage, String bloodtype, String job, String education, String belief, String phone, String emergencycall, String addr, int doctor, int hid) { super(); this.id = id; this.name = name; this.card = card; this.sex = sex; this.birthday = birthday; this.nation = nation; this.marriage = marriage; this.bloodtype = bloodtype; this.job = job; this.education = education; this.belief = belief; this.phone = phone; this.emergencycall = emergencycall; this.addr = addr; this.doctor = doctor; this.hid = hid; } public CusbasicInfo() { super(); } }

81,095

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧