Spring Controller在tomcat服务器上返回空白页面

时间:2015-03-31 14:00:21

标签: java tomcat controller

我在Apache Tomcat v8上运行我的项目,每当我尝试访问它的任何部分时,我都会在服务器控制台中看到一个没有错误的白色空白页。

以下是signin.html页面的控制器。

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class SigninController {

    @RequestMapping(value = "signin")
    public String signin() {
        return "signin/signin";
    }
}

这是我的signin.html页面

    <!DOCTYPE html>
<html>
<head>
    <title>Sign In</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <link href="../../../resources/css/bootstrap.min.css" rel="stylesheet" media="screen" th:href="@{/resources/css/bootstrap.min.css}"/>
    <link href="../../../resources/css/core.css" rel="stylesheet" media="screen" th:href="@{/resources/css/core.css}" />
</head>
<body>
<form class="form-narrow form-horizontal" action="/j_spring_security_check" method="post" th:action="@{/j_spring_security_check}">
    <th:block th:if="${param.error != null}">
        <div th:replace="fragments/alert :: alert (type='danger', message='Sign in error. Please try again.')">Alert</div>
    </th:block>
    <fieldset>
        <legend>Please Sign In</legend>
        <div class="form-group">
            <label for="inputEmail" class="col-lg-2 control-label">Email</label>
            <div class="col-lg-10">
                <input type="text" class="form-control" id="inputEmail" placeholder="Email" name="j_username" />
            </div>
        </div>
        <div class="form-group">
            <label for="inputPassword" class="col-lg-2 control-label">Password</label>
            <div class="col-lg-10">
                <input type="password" class="form-control" id="inputPassword" placeholder="Password" name="j_password" />
            </div>
        </div>
        <div class="form-group">
            <div class="col-lg-offset-2 col-lg-10">
                <div class="checkbox">
                    <label>
                        <input type="checkbox" name="_spring_security_remember_me" /> Remember me
                    </label>
                </div>
            </div>
        </div>
        <div class="form-group">
            <div class="col-lg-offset-2 col-lg-10">
                <button type="submit" class="btn btn-default">Sign in</button>
            </div>
        </div>
        <div class="form-group">
            <div class="col-lg-offset-2 col-lg-10">
                <p>New here? <a href="signup" th:href="@{/signup}">Sign Up</a></p>
            </div>
        </div>
    </fieldset>
</form>
</body>
</html>

每次去http://localhost:8080/intelegentsia-testapp/signin时,我都会在服务器控制台中看到一个空白页面。

0 个答案:

没有答案