Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/38.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
Java Css不工作主题解析器spring mvc_Java_Css_Spring Mvc - Fatal编程技术网

Java Css不工作主题解析器spring mvc

Java Css不工作主题解析器spring mvc,java,css,spring-mvc,Java,Css,Spring Mvc,我是SpringMVC的新手,正在开发一个应用程序。我试图改变主页的主题。但在遵循必要的步骤后,我看不到任何变化。下面是我的应用程序的代码和目录结构: spring dispatcher servlet.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springfr

我是SpringMVC的新手,正在开发一个应用程序。我试图改变主页的主题。但在遵循必要的步骤后,我看不到任何变化。下面是我的应用程序的代码和目录结构:

spring 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:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns:mvc="http://www.springframework.org/schema/mvc"
   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.xsd">

   <context:component-scan base-package="com.jobsearchs"/>
   <mvc:annotation-driven/>
   <mvc:interceptors>
    <mvc:interceptor>
        <mvc:mapping path="/Login.html"/>
        <bean class="com.jobsearchs.UriInterceptor"/>
    </mvc:interceptor>
    <mvc:interceptor>
        <mvc:mapping path="/Logout.html"/>
        <bean class="com.jobsearchs.EndTimeInterceptor"/>
    </mvc:interceptor>

   </mvc:interceptors>

   <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
      <property name="prefix" value="/WEB-INF/" />
      <property name="suffix" value=".jsp" />
   </bean>
   <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
            <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
            <property name="url" value="jdbc:mysql://localhost:3306/jobsearch"/>
            <property name="username" value="root"/>
            <property name="password" value="1234"/>
        </bean>
   <bean id="uuserDao" class="com.jobsearchs.userDao">
            <property name="dataSource" ref="dataSource"/>
        </bean>
   <bean id="themeSource" class="org.springframework.ui.context.support.ResourceBundleThemeSource">
    <property name="basenamePrefix" value="theme-"/>
   </bean>
<bean id="themeChangeInterceptor"
    class="org.springframework.web.servlet.theme.ThemeChangeInterceptor">
    <property name="paramName" value="theme" />
</bean>
<bean id="themeResolver"
    class="org.springframework.web.servlet.theme.CookieThemeResolver">
    <property name="defaultThemeName" value="default" />
</bean>
<mvc:resources mapping="/themes/**" location="/resources/themes/"></mvc:resources>

 <mvc:interceptors>
    <ref bean="themeChangeInterceptor"/>
</mvc:interceptors> 
   </beans>

AdminUserPage.jsp

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <%@taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
     <%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
 <link rel="stylesheet" href="<spring:theme code='styleSheet'/>" type="text/css"/>

 <!--  <link rel="stylesheet" href="/red.css" type="text/css"/>-->
<title>Job Search</title>
</head>
<body>
<form:errors path="u1.*"/>
<span style="float: left">
    <a href="?theme=default">default</a> 
    | 
    <a href="?theme=grey">grey</a>
    | 
    <a href="?theme=red">red</a>
</span><br><br>
<form action="/JobSearch/Login.html" method="POST">
<h1>Login</h1>
<table>
    <tr>
        <td>Name:</td><td><input type="text" name="uname"/></td>
        <td>Password:</td><td><input type="password" name="password"/></td>
    </tr>
</table>
<input type="submit" value="login"/>
</form>
<br><br>
<form action="/JobSearch/Register.html" method="POST">
<h1>Register</h1>
<table>
    <tr>
        <td>Name:</td><td><input type="text" name="uname"/></td>
        <td>Password:</td><td><input type="password" name="password"/></td>
        <td>Confirm Password:</td><td><input type="password" name="cpwd"/></td>
        <td>Email Id:</td><td><input type="text" name="emailid"/></td>
        <td>Contact Number:</td><td><input type="text" name="contactno"/></td>
        <td>Select Your Position: </td><td><select name="position"><option value="Recruiter" selected>Recruiter</option>
        <option value="Joinee">Joinee</option></select></td>
    </tr>
</table>
<input type="submit" value="Register"/>
</form>
</body>
</html>

Besides this,
I have made three property files with the following specifications:
1) theme-default.properties:-styleSheet=/themes/default.css
2) theme-grey.properties:-styleSheet=/themes/grey.css
3) theme-red.properties:-styleSheet=/themes/red.css

Along with this I am posting my directory structure:

求职
| 
| 


登录 姓名: 密码:

登记 姓名: 密码: 确认密码: 电子邮件Id: 联络电话: 选择你的职位:招聘人员 加入者 除此之外,, 我制作了三个具有以下规格的财产文件: 1) theme default.properties:-styleSheet=/themes/default.css 2) theme grey.properties:-样式表=/themes/grey.css 3) theme red.properties:-样式表=/themes/red.css 除此之外,我还发布了我的目录结构:


请提供帮助。

我认为映射不正确。正确的映射是什么?因为主题文件不在resources文件夹下,所以这一行应该省略。它不起作用。。我试着去掉那条线。。。好心帮忙