距离开始捣鼓这个系统9天了,目前框架总算是能运行了,这几天主要困扰的问题以下:css
1.一开始用的springmvc3和hibernate3整合,可是老是有包不全(hibernate3.jar在maven库中没找到,多是别的名字吧),因而改为spingmvc4和hibernate4版本了。html
2.好不容易搭建完,运行时总是报错,找不到本身写的一个过滤器,折磨了我几天后才发现eclipse中project-clean操做后,就行了(不晓得怎么回事,求大神指点)java
3.sh3升到sh4版本仍是有不少问题的,不过网上找一下的话仍是好找的,改动也不是很大,好比ajax功能报错,我参考的这个好了http://www.zuidaima.com/question/2051293900327936.htmweb
具体操做记下,省的原网页没了:ajax
经过万能的stackoverflow解决了问题,不仅是须要加pomspring
<!-- For JSON --> <dependency> <groupId>org.codehaus.jackson</groupId> <artifactId>jackson-core-asl</artifactId> <version>${jackson.version}</version> </dependency> <dependency> <groupId>org.codehaus.jackson</groupId> <artifactId>jackson-mapper-asl</artifactId> <version>${jackson.version}</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-core</artifactId> <version>2.4.3</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> <version>2.4.3</version> </dependency>
还须要在applicationContext.xml中增长mvc
<mvc:annotation-driven content-negotiation-manager="contentNegotiationManager" /> <bean id="contentNegotiationManager" class="org.springframework.web.accept.ContentNegotiationManagerFactoryBean"> <!-- Turn off working out content type based on URL file extension, should fall back to looking at the Accept headers --> <property name="favorPathExtension" value="false" /> </bean>
4.登陆页面图片等静态资源显示不出来,报302错误,后来发现由于我加了个本身写的登陆过滤器,在没登陆时的静态资源都给跳转了,解决方法是在过滤器中加了url地址校验,在sesson中没有登陆用户的状况下,将含静态资源信息的url排除掉,不进行跳转,详细代码以下:(不知道是否是能够经过配置文件跳过这么麻烦的操做,配置个人DispatcherServlet中的过滤地址写的是“/”,若是写成”*.do”就没这些问题了,可是提交url都得加上个”.do”)app
@Override
public void doFilter(ServletRequest req, ServletResponse resp,
FilterChain chain) throws IOException, ServletException {
HttpServletRequest hsq = (HttpServletRequest)req;
User u = (User)hsq.getSession().getAttribute("loginUser");
String uri = hsq.getRequestURI();
if(u==null&&uri.indexOf("/login") == -1&&uri.indexOf(".css") == -1&&uri.indexOf(".JPG")==-1&&uri.indexOf(".gif")==-1
&&uri.indexOf(".jpg") == -1&&uri.indexOf(".png")==-1&&uri.indexOf("SnowCheckCode") == -1) {
((HttpServletResponse)resp).sendRedirect(hsq.getContextPath()+"/login");
}
chain.doFilter(req, resp);
}
框架
5.运行过程当中报错:。。。。cannot be cast to javassist.util.proxy.Proxy。。。。 原来是jar包冲突 ,网上看的人家的解决办法:http://www.cnblogs.com/newsouls/p/3942116.htmleclipse