主题 : IndexStaticJob |
级别: 秀才
![]() |
1# 发表于:2015-11-20 10:55:48 IP:1.213.*.*
|
||||
---|---|---|---|---|---|
级别: 秀才
![]() |
3# 发表于:2015-11-20 11:08:17 IP:1.213.*.*
回复第2楼 我用的v6
这个方法会刷新页面么? @Transactional(readOnly = true) public void index(CmsSite site) throws IOException, TemplateException { Map<String, Object> data = new HashMap<String, Object>(); FrontUtils.frontData(data, site, null, site.getUrlStatic(), null); /* String tpl = FrontUtils.getTplPath(tplMessageSource, site .getLocaleAdmin(), site.getSolutionPath(), TPLDIR_INDEX, TPL_INDEX); */ String tpl=site.getTplIndexOrDef(); index(site, tpl, data); } |
||
---|---|---|---|
级别: 秀才
![]() |
5# 发表于:2015-11-20 11:12:21 IP:1.213.*.*
回复第4楼FreeMarker template error: The following has evaluated to null or missing: ==> copyright [in template "WEB-INF/t/cms/www/default/index/index.html" at line 434, column 16] Tip: If the failing expression is known to be legally null/missing, either specify a default value with myOptionalVar!myDefault, or use [#if myOptionalVar??]when-present[#else]when-missing[/#if]. (These only cover the last step of the expression; to cover the whole expression, use parenthessis: (myOptionVar.foo)!myDefault, (myOptionVar.foo)?? The failing instruction (FTL stack trace): ---------- ==> ${copyright} [in template "WEB-INF/t/cms/www/default/index/index.html" at line 434, column 14] ---------- Java stack trace (for programmers): ---------- freemarker.core.InvalidReferenceException: [... Exception message was already printed; see it above ...] at freemarker.core.InvalidReferenceException.getInstance(InvalidReferenceException.java:98) at freemarker.core.EvalUtil.coerceModelToString(EvalUtil.java:382) at freemarker.core.Expression.evalAndCoerceToString(Expression.java:115) at freemarker.core.DollarVariable.accept(DollarVariable.java:76) at freemarker.core.Environment.visit(Environment.java:265) at freemarker.core.MixedContent.accept(MixedContent.java:93) at freemarker.core.Environment.visit(Environment.java:265) at freemarker.core.Environment.process(Environment.java:243) at freemarker.template.Template.process(Template.java:277) at com.jeecms.cms.staticpage.StaticPageSvcImpl.index(StaticPageSvcImpl.java:172) at com.jeecms.cms.staticpage.StaticPageSvcImpl.index(StaticPageSvcImpl.java:155) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy50.index(Unknown Source) at com.jeecms.cms.task.job.IndexStaticJob.staticIndex(IndexStaticJob.java:55) at com.jeecms.cms.task.job.IndexStaticJob.executeInternal(IndexStaticJob.java:45) at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:113) at org.quartz.core.JobRunShell.run(JobRunShell.java:202) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529)
|
||
---|---|---|---|
级别: 秀才
![]() |
7# 发表于:2015-11-20 11:17:01 IP:1.213.*.*
回复第6楼
进入首页时从配置项取的。在DynamicPageAct里边 @RequestMapping(value = "/", method = RequestMethod.GET) public String index(HttpServletRequest request,HttpServletResponse response, ModelMap model) { CmsSite site = CmsUtils.getSite(request); model.put("copyright", ConfigureFileHelper.copyright); model.put("footerAddess", ConfigureFileHelper.footerAddess); model.put("postCode", ConfigureFileHelper.postCode); FrontUtils.frontData(request, model, site); //带有其他路径则是非法请求 String uri=URLHelper.getURI(request); if(StringUtils.isNotBlank(uri)&&!uri.equals("/")){ return FrontUtils.pageNotFound(request, response, model); } //使用静态首页而且静态首页存在 if(site.getStaticIndex()&&new File(realPathResolver.get(site.getStaticDir()+INDEX)).exists()){ return FrontUtils.getTplPath("", site.getStaticDir(), INDEX); }else{ return site.getTplIndexOrDef(); } } 刚开始是正常的,保持tomcat启动多段时间就会自动报错,刚刚的就是报错信息 |
||
---|---|---|---|