我与bug不共戴天 2020-10-20 19:59 采纳率: 0%
浏览 261

前台jsp页面无法跳转到controller层(确定没有走到controller)求助(jsp没有进入js)

20-Oct-2020 19:51:45.237 淇℃伅 [http-nio-8083-exec-1] org.springframework.web.servlet.FrameworkServlet.initServletBean Initializing Servlet 'dispatcherServlet'
20-Oct-2020 19:51:46.030 淇℃伅 [http-nio-8083-exec-1] org.springframework.web.servlet.FrameworkServlet.initServletBean Completed initialization in 793 ms
20-Oct-2020 19:51:46.164 淇℃伅 [http-nio-8083-exec-1] com.alibaba.druid.support.logging.JakartaCommonsLoggingImpl.info {dataSource-1} inited
20-Oct-2020 19:51:50.640 淇℃伅 [Catalina-utility-1] org.apache.catalina.startup.HostConfig.deployDirectory 鎶妛eb 搴旂敤绋嬪簭閮ㄧ讲鍒扮洰褰� [D:\study\software\websoftware\apache-tomcat-9.0.33\webapps\manager]
20-Oct-2020 19:51:50.669 淇℃伅 [Catalina-utility-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [D:\study\software\websoftware\apache-tomcat-9.0.33\webapps\manager] has finished in [30] ms

jsp代码

<div class="mask hidden" id="login">
    <div class="mask_content">
        <div class="mask_content_header">
            <img src="${pageContext.request.contextPath}/img/logo.png" alt="" class="ma">
        </div>
        <div class="mask_content_body">
           <form id="loginForm" action="#">
                <h3>快速登录</h3>
                <input type="email" id="loginEmail" placeholder="请输入邮箱" name="email">
                <input type="password" id="loginPassword" placeholder="请输入密码" name="password">
                <div id="forget">
                    <a href="${pageContext.request.contextPath}/user/forgetPassword">忘记密码?</a>
                </div>
                <input type="submit" onclick="return commitLogin()" value="登&#x3000;录">
            </form>
        </div>
        <div class="mask_content_footer">
            <span id="login_close">关&#x3000;闭</span>
        </div>
    </div>
</div>

js代码

function getRootPath() {
    var pathname = window.location.pathname.substring(1);
    var end = pathname.indexOf('/');
    pathname = pathname.substring(0, end);
    return pathname;
}

function commitLogin() {
    var email = $("#loginEmail").val();
    alert(email)
    var password = $("#loginPassword").val();
    alert(password)
    if (null != email && email != "" && null != password && password != "") {
        var params = $("#loginForm").serialize();
        // alert(params);
        // post要小写

        $.post('/' + getRootPath() + "/user/loginUser", params, function (data) {
            // alert(data);
            if (data == 'success') {

                //登录框消失
                $("#login").addClass("hidden");

                $("#account").text($("#loginEmail").val());
                //将注册的user信息展示
                $("#regBlock").css("display", "none");
                $("#userBlock").css("display", "block");

                $("#isLogin").val(1);
            }
        });

        return false;
    }

    return false;
}
  • 写回答

1条回答 默认 最新

      报告相同问题?

      相关推荐 更多相似问题

      悬赏问题

      • ¥70 基于模糊控制的统一混沌控制器代码
      • ¥15 有没有精通光束整形的能读懂
      • ¥15 关于#STM32#与AMG8833采用双插值算法进行热成像显示不正常的问题,如何解决?
      • ¥15 求解! 头歌操作系统 课堂练习6.1 块设备访问
      • ¥15 comsol低温等离子体射流气体摩尔分数作为初始摩尔浓度参数输入到介质管出口流注无法推进了
      • ¥15 有没有人解答51的这个问题,如何解决?(关键词-数码管)
      • ¥15 python 爬虫问题
      • ¥15 求运用模拟退火算法寻优,以下是参考我的参考代码
      • ¥15 VB6.0中OptionButton不能赋值TextBox100
      • ¥15 主窗体激活keydown事件,但是阻塞了主线程