我有一个spring应用,可将视频上传到tomcat服务器。视频已上传到tomcat服务器中名为 Video-App / content / upload 的文件夹中。例如,http://192.168.1.63:8080/Video-App/content/upload/85.mp4
是一个示例链接。我有一个Android应用程序,可以下载该视频并通过下载管理器将其保存在android设备中。如果下载视频时出现网络故障,则android下载管理器会从头开始重新启动整个下载过程。但是,如果将视频放到tomcat的根文件夹(例如:http://192.168.1.63:8080/85.mp4
)中,下载将从停止点恢复。
我的Spring应用程序中有什么要做的配置吗?
这是我的applicationContent.xml。
<context:annotation-config />
<!-- Activates scanning of @Repository and @Service -->
<context:component-scan base-package="com.vapp.data"/>
<mvc:annotation-driven />
<mvc:resources mapping="/css/**" location="/css/" />
<mvc:resources mapping="/js/**" location="/js/" />
<mvc:resources mapping="/img/**" location="/img/" />
<mvc:resources mapping="/bootstrap/**" location="/bootstrap/" />
<mvc:resources mapping="/dist/**" location="/dist/" />
<mvc:resources mapping="/plugins/**" location="/plugins/" />
<mvc:resources mapping="/content/**" location="/content/" />
<tx:annotation-driven transaction-manager="txManager" />
<jee:jndi-lookup jndi-name="jdbc/vapp" id="dataSource" />
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="mappingResources" value="com/vapp/data/modal/hibernate.hbm.xml" />
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop>
<prop key="hibernate.show_sql">false</prop>
<prop key="hibernate.format_sql">true</prop>
<prop key="hibernate.cache.use.query_cache">false</prop>
<prop key="hibernate.enable_lazy_load_no_trans">true</prop>
<prop key="hibernate.cache.use_second_level_cache">false</prop>
</props>
</property>
</bean>
<bean id="txManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<util:list id="propertyList">
<value>classpath:errorString</value>
</util:list>
<bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
<property name="basenames" ref="propertyList" />
</bean>
<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<property name="maxUploadSize" value="4294967296"/>
</bean>
<bean
class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver">
<property name="exceptionMappings">
<props>
<prop key="java.lang.Exception">Error</prop>
</props>
</property>
</bean>
</beans>
如果有人可以帮助我,我可以上传其他任何代码。 谢谢。