Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
sitemesh和spring:仅修饰index.jsp_Spring_Spring Mvc_Sitemesh - Fatal编程技术网

sitemesh和spring:仅修饰index.jsp

sitemesh和spring:仅修饰index.jsp,spring,spring-mvc,sitemesh,Spring,Spring Mvc,Sitemesh,我正在尝试将sitemesh包含到我的spring mvc web应用程序中。 我在我的web.xml中添加了以下内容: <filter> <filter-name>sitemesh</filter-name> <filter-class>com.opensymphony.module.sitemesh.filter.PageFilter</filter-class> </filter> <filter-mappin

我正在尝试将sitemesh包含到我的spring mvc web应用程序中。 我在我的web.xml中添加了以下内容:

<filter>
<filter-name>sitemesh</filter-name>
<filter-class>com.opensymphony.module.sitemesh.filter.PageFilter</filter-class>
</filter>

<filter-mapping>
<filter-name>sitemesh</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
My decorators.xml-file:

<decorators defaultdir="/WEB-INF/decorators">
    <decorator name="master" page="master.jsp">
        <pattern>/</pattern>
    </decorator>
</decorators>
以及master.jsp文件:

<%@ taglib prefix="decorator" uri="http://www.opensymphony.com/sitemesh/decorator" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>
        :: LiVis :: <decorator:title /> ::
    </title>
    <style type="text/css">@import "resources/css/generalStyle.css";</style>
    </head>
    <body>
        <div id="wrapper">
            <div id="header">
                <div id="headerPicture">
                    <img id="livis" src="resources/images/village.png" alt="livis" />
                </div>
                <div id="headerMenu">
                    <ul id="navigation">
                        <li><a href="admin/insertEntryForm.html">Insert</a></li>
                        <li>Table-View</li>
                        <li>Graph-View</li>
                        <li>About</li>
                    </ul>
                </div>
            </div>
            <div id="main">
                <decorator:body />
            </div>
        </div>
    </body>
</html>
我认为master.jsp将应用于我的webapp中的每个页面,但它只使用index.jsp完成。 要查看WEB-INF/views中某些文件夹中的其他jsp文件,请查看未完成的图片。

这可能是什么原因? 谢谢

编辑

vwies/admin文件夹中的页面:

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<head>
<title>Registration Page</title>
</head>
<body>

<form:form method="POST" action="/LiteratureVisualization/admin/insertTest" modelAttribute="object">
    <table>
        <tr>
            <td>First name:</td>
            <td><form:input path="author.firstname" /></td>
        </tr>
        <tr>
            <td>Last name:</td>
            <td><form:input path="author.lastname" /></td>
        </tr>
        <tr>
            <td>Title:</td>
            <td><form:input path="publication.title" /></td>
        </tr>
        <tr>
            <td>Subtitle:</td>
            <td><form:input path="publication.subtitle" /></td>
        </tr>
        <tr>
            <td>Abstract:</td>
            <td><form:input path="publication.abstr" /></td>
        </tr>
        <tr>
            <td>Year of Launch:</td>
            <td><form:input path="publication.launchYear" /></td>
        </tr>
        <tr>
            <td>Month of Launch:</td>
            <td><form:input path="publication.launchMonth" /></td>
        </tr>
        <tr>
            <td>Volume:</td>
            <td><form:input path="publication.volume" /></td>
        </tr>
        <tr>
            <td>Number:</td>
            <td><form:input path="publication.number" /></td>
        </tr>
        <tr>
            <td>Sort of:</td>
            <td><form:input path="publication.sortOf" /></td>
        </tr>
        <tr>
            <td>Published In:</td>
            <td><form:input path="publication.publishedIn" /></td>
        </tr>
        <tr>
            <td colspan="2"><input type="submit" value="Register"></td>
        </tr>
    </table>
</form:form>
</body>
</html>

在模式声明中使用/*而不是/


或者,如果它不能解决问题,请查看jsp文件并检查其中是否包含html和body标记。如果没有,sitemesh将无法用装饰器中声明的标记替换标记。

这不起作用。。。有没有可能,在管理员、浏览、常规和图形文件夹中找不到jsp?您能编辑您的帖子并向我们显示该文件夹中的页面吗?您是否尝试添加类似于:/views/admin/*的模式来测试这是路径问题还是jsp问题?