我成功将css添加到我的index.jsp中。但现在它在我的其他jsp文件中自动重复而不调用css?
为什么会这样?
这是我的index.jsp。提交后,它将重定向到其他页面。但另一页自动使用css
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<html>
<head>
<title>My page</title>
<link rel="stylesheet" type="text/css" href="themes/Bootstrap.css">
<link rel="stylesheet" href="themes/jquery.mobile.structure-1.2.0.min.css" />
<link rel="stylesheet" type="text/css" href="themes/jqm-icon-pack-1.1.1-fa.css">
<script src="js/jquery-1.8.2.min.js"></script>
<script src="js/jquery.mobile-1.2.0.min.js"></script>
</head>
<body>
<div data-role="page" data-theme="e">
<header data-role="header" data-position="inline" data-theme="e">
<h2>Login</h2>
</header>
<div data-role="content" data-theme="e">
<form:form method="POST" commandName="login">
<label for="username">Username:</label>
<form:input path="username" id="username"/>
<form:errors path="username" cssClass="error" />
<br />
<label for="password">Password:</label>
<form:password path="password" id="password"/>
<form:errors path="password" cssClass="error" />
<input type="submit" value="Login" data-role="button" data-theme="e" />
</form:form>
</div>
</div>
</body>
这是我的dispatcher-servlet.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">
<context:component-scan base-package="org.pratesis.prototype.bi.controller"/>
<bean class="org.pratesis.prototype.bi.validator.LoginValidator"/>
<bean id="messageSource"
class="org.springframework.context.support.ResourceBundleMessageSource">
<property name="basename" value="org/pratesis/prototype/bi/properties/Login" />
</bean>
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix">
<value>/WEB-INF/jsp/</value>
</property>
<property name="suffix">
<value>.jsp</value>
</property>
</bean>
<mvc:annotation-driven/>
<mvc:resources mapping="/themes/**" location="/themes/" />
<mvc:resources mapping="/js/**" location="/js/" />