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

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 关于网上一个easyx制作的见缝插针小游戏(c++)
    • ¥15 开地址法双散列函数处理碰撞
    • ¥15 想问一下这个是什么情况 虚拟机Linux打不开了
    • ¥15 联通光猫掉注册了怎么重新注册上去
    • ¥15 关于unity开发steamvr程序遇到的问题
    • ¥60 求tc downloader的下载方式
    • ¥15 华为 快捷方式 手电筒 接口
    • ¥15 Qt6.5支不支持Android13开发啊
    • ¥20 网络只能跑一半,应该如何设置
    • ¥20 Python调用百度开发者平台人脸识别接口