1. 程式人生 > >解釋一個struts2丟擲的異常

解釋一個struts2丟擲的異常

在用struts2開發的過程中,經常會看到struts2丟擲的下列的異常:

22:16:50,437 ERROR [ParametersInterceptor] - <ParametersInterceptor - [setParameters]: Unexpected Exception catched: Error setting expression 'user_rd' with value '[Ljava.lang.String;@13099cc'>
很多開發人員不清除為什麼老丟擲這個異常,其實很簡單,上面說的很清除,這是ParametersInterceptor過濾器丟擲的異常,ParametersInterceptor的功能是轉換request中parameter到action中的屬性,如果在request中存在某個名稱的parameter,而在action沒有這個對應的屬性,struts2會丟擲這個異常,上面的異常說的是request中有個user_rd,而在action中沒有名叫user_rd屬性