您好,登錄后才能下訂單哦!
在我之前的一篇博文中《基于struts2 攔截器ResultType為chain的Action之間數(shù)據(jù)傳遞 ——表單頁面打開優(yōu)化》提到使用chain類型的action之間傳遞數(shù)據(jù)用以優(yōu)化表單頁面iframe的加載速度。今天,其實應(yīng)該之前,曾經(jīng)也出現(xiàn)過如下的報錯信息(生產(chǎn)系統(tǒng)),當時的問題是flowFormNextViewIndex的result對應(yīng)的jsp存在錯誤,但該錯誤未直接報出,反倒給出一堆莫針的提示,比如這篇文章提到關(guān)于struts2表單提交Infinite recursion detected問題原因的疑問,因頁面與實體bean定義存在不一致,因使用chain類型莫名報出該錯誤的困惑。剛在調(diào)試其他問題的時候,我本地也一閃而過該報錯。當我重啟tomcat時,該報錯消失。
對于網(wǎng)上可供查詢的資料,多數(shù)方案是去掉chain類型,或者去掉自定義的攔截器:
比如:
報錯信息:
HTTP Status 500 - Infinite recursion detected: [/workflow/doJob!doJob, /workflow/flowFormNextViewIndex, /workflow/flowFormNextViewIndex]
type Exception report
message Infinite recursion detected: [/workflow/doJob!doJob, /workflow/flowFormNextViewIndex, /workflow/flowFormNextViewIndex]
description The server encountered an internal error that prevented it from fulfilling this request.
exception
Infinite recursion detected: [/workflow/doJob!doJob, /workflow/flowFormNextViewIndex, /workflow/flowFormNextViewIndex] - [unknown location] com.opensymphony.xwork2.ActionChainResult.execute(ActionChainResult.java:214) com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:371) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:275) com.gc.platform.web.struts.interceptor.ExceptionInterceptor.exception(ExceptionInterceptor.java:83) com.gc.platform.web.struts.interceptor.ExceptionInterceptor.intercept(ExceptionInterceptor.java:59) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54) org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:563) org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77) org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:99) com.gc.platform.web.context.filter.ContextFilter2.doFilter(ContextFilter2.java:115) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) org.jasig.cas.client.util.AssertionThreadLocalFilter.doFilter(AssertionThreadLocalFilter.java:54) org.jasig.cas.client.util.HttpServletRequestWrapperFilter.doFilter(HttpServletRequestWrapperFilter.java:75) org.jasig.cas.client.validation.AbstractTicketValidationFilter.doFilter(AbstractTicketValidationFilter.java:201) org.jasig.cas.client.authentication.AuthenticationFilter.doFilter(AuthenticationFilter.java:107) org.jasig.cas.client.session.SingleSignOutFilter.doFilter(SingleSignOutFilter.java:76)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.39 logs.
最后經(jīng)我確認,發(fā)現(xiàn)該錯誤的原因由另外一個已發(fā)現(xiàn)的bug引起:
該錯誤已經(jīng)定位,在taskRun.jsp頁面中,有兩個工作入口,一個是點擊辦理任務(wù)鏈接,一個點擊流程名。在ie和fixfox中點擊流程名是報錯的,報錯如上。
其代碼如下:
return '<a class="link_text" href="javacript:;" onclick="process(\''+value.id+'\')">'+value.name+'</a>'+ temp;
修改后的如下:
return '<a class="link_text" href="#" onclick="process(\''+value.id+'\')">'+value.name+'</a>'+ temp;
兩者區(qū)別只是一個href為javascript,一個是#。<a>標簽的作用
1一般作用的跳轉(zhuǎn)頁面 需要設(shè)置跳轉(zhuǎn)的頁面就是 在href屬性中設(shè)置要跳轉(zhuǎn)的地址 2.作為一個按鈕使用,可以點擊 但是不跳轉(zhuǎn)頁面而是做其他處理,就需要設(shè)置href 屬性為javascript:
而#的作用和javascript:void(0);相同,即原頁面跳回頂部。
但在實際應(yīng)用中,空的javasript在ie和fixfox中還報出了錯誤。其中fixfox報出的錯誤即本文Infinite recursion detected,可見各種錯誤都可能引起該錯誤的報出,而真實的錯誤往往被隱藏了。
在這篇文章Struts Problem Report中作者提到:
Struts has detected an unhandled exception:
Messages: |
|
You are seeing this page because development mode is enabled. Development mode, or devMode, enables extra debugging behaviors and reports to assist developers. To disable this mode, set:
struts.devMode=false
in your WEB-INF/classes/struts.properties
file.
關(guān)于 devMode,請參考
免責聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。