maven项目通过package打包在centos6.5上运行,freemarker运行报错,本地运行正常
报错内容:HTTP Status 500 - Could not resolve view with name 'views/weatherlog' in servlet with name 'springMVC'
<?xml version="1.0" encoding="UTF-8"?>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:context="http://www.springframework.org/schema/context"
xmlns:mongo="http://www.springframework.org/schema/data/mongo"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/data/mongo
http://www.springframework.org/schema/data/mongo/spring-mongo.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">
<context:component-scan base-package="mongodb.*" />
<!-- MVC配置 代替 映射器和解析器 -->
<mvc:annotation-driven validator="validator" />
<!-- 校验器 -->
<!-- 以下 validator ConversionService 在使用 mvc:annotation-driven 会 自动注册 -->
<bean id="validator"
class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean">
<property name="providerClass" value="org.hibernate.validator.HibernateValidator" />
<!-- 如果不加默认到 使用classpath下的 ValidationMessages.properties -->
<property name="validationMessageSource" ref="messageSource" />
</bean>
<bean id="messageSource"
class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
<property name="basename" value="classpath:messages" />
<property name="fileEncodings" value="utf-8" />
<property name="cacheSeconds" value="120" />
</bean>
<!-- 解析器注册 -->
<bean
class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter">
<property name="messageConverters">
<list>
<ref bean="stringHttpMessageConverter" />
</list>
</property>
</bean>
<!-- String类型解析器,允许直接返回String类型的消息 -->
<bean id="stringHttpMessageConverter"
class="org.springframework.http.converter.StringHttpMessageConverter" />
<bean
class="org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver">
<property name="prefix" value="/" />
<property name="suffix" value=".ftl" />
<property name="contentType" value="text/html; charset=utf-8" />
</bean>
<bean id="freemakerCongfig"
class="org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer"
p:templateLoaderPath="/">
<property name="freemarkerSettings">
<props>
<!-- 默认编码 -->
<prop key="defaultEncoding">UTF-8</prop>
<!-- 去掉数字格式化 -->
<prop key="number_format">#.##</prop>
<!-- 导入自定义内容 -->
<prop key="auto_import">/ftl/index.ftl as f</prop>
<!-- 处理空值为空字符串 -->
<prop key="classic_compatible">true</prop>
</props>
</property>
<property name="freemarkerVariables">
<map>
<entry key="left">
<bean class="com.jdog.frameworks.freemarker.directive.FreeMarkerLeft" />
</entry>
<entry key="block">
<bean
class="com.jdog.frameworks.freemarker.directive.FreeMarkerBlockDirective" />
</entry>
</map>
</property>
</bean>