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

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 虚拟机打包apk出现错误
  • ¥30 最小化遗憾贪心算法上界
  • ¥15 用visual studi code完成html页面
  • ¥15 聚类分析或者python进行数据分析
  • ¥15 逻辑谓词和消解原理的运用
  • ¥15 三菱伺服电机按启动按钮有使能但不动作
  • ¥15 js,页面2返回页面1时定位进入的设备
  • ¥50 导入文件到网吧的电脑并且在重启之后不会被恢复
  • ¥15 (希望可以解决问题)ma和mb文件无法正常打开,打开后是空白,但是有正常内存占用,但可以在打开Maya应用程序后打开场景ma和mb格式。
  • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝