Java项目部署到linux时访问controller层时报404,但在windows上是正常的,这要怎么解决?
spring-mvc的配置
<!--组件扫描,主要扫描controller-->
<context:component-scan base-package="Dzp.controller"/>
<!-- 注解mvc注解驱动-->
<mvc:annotation-driven/>
<!-- 配置内部资源视图解析器-->
<bean id="resourceViewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/pages/"/>
<property name="suffix" value=".html"/>
</bean>
<!--开放静态资源权限-->
<mvc:default-servlet-handler></mvc:default-servlet-handler>
</beans>
web.xml配置
<!--找到指定的spring配置文件-->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext*.xml</param-value>
</context-param>
<!-- spring监听器-->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!-- spring_mvc前端控制器-->
<servlet>
<servlet-name>DispatcherServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring-mvc.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>DispatcherServlet</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<!-- 乱码过滤器-->
<filter>