问题收集

1.springMVC静态文件(图片)访问

web.XML中

<servlet-mapping>
   <servlet-name>springMVC</servlet-name>
   <url-pattern>/</url-pattern><!-- 意思是拦截所有请求 -->
  </servlet-mapping>

导致工程图片无法显示

可在
spring-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:p="http://www.springframework.org/schema/p"
 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
                    ">
    <mvc:resources location="/img/" mapping="/img/**"/>
    <mvc:resources location="/js/" mapping="/js/**"/>
    <bean name="/test/static" class="com.mcm.web.controller.StaticController">
     <property name="methodNameResolver">
      <ref bean="paramMethodResolver"/>
     </property>
    </bean>
  <bean id="paramMethodResolver" class="org.springframework.web.servlet.mvc.multiaction.ParameterMethodNameResolver">
  <property name="paramName" value="action"/>
    </bean>
 <!-- 配置视图解析器 -->
 <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
     <property name="prefix" value="/"/>
     <property name="suffix" value=".jsp"/>
 </bean>                 
 </beans>

2不需要登陆就能访问的controller

3memcached set成功 get null

1).memcached安装地址配置了?

2).set进去的缓存项的过期时间比memcached的启动时间还要早,那就怪不得我get的时候就get不到了,因为它已经过期了。原来问题在这 里,那为什么会这样呢,这时我发现虚拟机的linux和windows2003的系统时间都跟本地机的不一样,这应该是memcached新版本启动时使 用服务器系统时间造成的。那是不是修改下系统时间就可以解决了。于是我马上对linux系统进行修改。

 1 tzselect //设置时区 
 2 cp /etc/localtime /etc/localtime.bak //备份当前时区设置
 3 cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime //用新的设置替换当前的默认设置
 4 date -s 01/23/2013 //修改日期
 5 date -s 22:36:40 //修改时间
 6 clock -w //把时间设置保存起来

    修改完成后,重新配置memcached,启动。

原文地址:https://www.cnblogs.com/dingding0505/p/3396028.html