白白白湫 2020-09-30 11:05 采纳率: 25.7%
浏览 315
已采纳

form以注解方式提交表单数据从html到servlet一直报错404

html上采用form提交表单数据,以注解的方式提交到servlet,但是跳转中报错404

        <form action="user.do" method="post" onsubmit="return checkForm(this);">
                <input type="text" id="user_phone" style="width: 400px;height: 40px;border-radius: 5px;background:#F0F8FF;border: none;margin-left: 30px;margin-top: 20px" placeholder="请输入你的手机号" onblur="checkPhone(this)"><span id="msg" style="font-size: 10px"></span>

                <input type="submit" value="注册" style="width:260px;height:40px;border-radius: 5px;margin-left: 30px;margin-top: 35px;background: #FF6600;border: none;">
                <br>
                <font style="font-size: 10px;margin-left: 50px">已有CC速递账号?<a href="login.html" style="color: #FF6600">直接登录 →</a></font>
            </form>

Servlet上的

            @WebServlet("/user.do")
                public class UserServlet extends HttpServlet 

网页一直报错404

  • 写回答

1条回答 默认 最新

  • qq_25376897 2020-09-30 11:49
    关注
      <form action="<%=request.getContextPath() %>/user.do" method="post" onsubmit="return checkForm(this);">
                <input type="text" id="user_phone" style="width: 400px;height: 40px;border-radius: 5px;background:#F0F8FF;border: none;margin-left: 30px;margin-top: 20px" placeholder="请输入你的手机号" onblur="checkPhone(this)"><span id="msg" style="font-size: 10px"></span>
    
                <input type="submit" value="注册" style="width:260px;height:40px;border-radius: 5px;margin-left: 30px;margin-top: 35px;background: #FF6600;border: none;">
                <br>
                <font style="font-size: 10px;margin-left: 50px">已有CC速递账号?<a href="login.html" style="color: #FF6600">直接登录 →</a></font>
            </form>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

问题事件

  • 已采纳回答 8月19日

悬赏问题

  • ¥15 centos7.9 IPv6端口telnet和端口监控问题
  • ¥120 计算机网络的新校区组网设计
  • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作
  • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
  • ¥20 海浪数据 南海地区海况数据,波浪数据
  • ¥20 软件测试决策法疑问求解答
  • ¥15 win11 23H2删除推荐的项目,支持注册表等
  • ¥15 matlab 用yalmip搭建模型,cplex求解,线性化处理的方法
  • ¥15 qt6.6.3 基于百度云的语音识别 不会改
  • ¥15 关于#目标检测#的问题:大概就是类似后台自动检测某下架商品的库存,在他监测到该商品上架并且可以购买的瞬间点击立即购买下单