blog2.0需要修改的一系列问题总结
点击首页第一个博客,会弹出窗口papapa,点击确认,才会显示博客内容。
解决办法:
总是弹出papapa这个问题,原因是因为数据库存储了未转译的字符,导致,将改数据显示出来时会发生html5读取数据
点击刷新页面,观看次数会增加二,并且每一次刷新都增加2
解决办法:
我这里写的输出,又重复运行了一遍
右侧标签栏,第一次打开页面有数据,第二次刷新,就全变为0了。
解决办法:因为type和blog存在一对多关系,但是blog的数据量特别打,所以在存入缓存时,需要将blog对象忽略存储,但是这样会导致一个问题,那就是存入的redis里面没有blog的数据,但是服务器读取的时候却要到redis中去取数据,所以,会导致,前台读取不到blog的数据
暂时的解决办法时,先把缓存注解注释掉,现在还没想好更合适的解决办法,也许需要更改对象结构
首页显示的观看次数,由于加入了缓存,不会发生变化
这个问题解决办法也是注释掉了缓存注解
点击归档报错:
java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Long
at com.wxl.service.impl.BlogServiceImpl$$EnhancerBySpringCGLIB$$f541da7c.countBlog(<generated>)
at com.wxl.web.ArchiveShowController.archives(ArchiveShowController.java:21)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:635)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
也是注释去掉注解