Struts2 action帶引數轉向

2021-09-12 04:28:32 字數 378 閱讀 5543

addcourseresult

$$$$$

$$$$

$/page/course/add_scorm_course.jsp

actionname是action的名稱,method是請求執行action中的哪個方法,

name是傳遞的引數名,在要定向的action裡要有set和get方法,$是要傳遞的引數值,在action裡要有set和get方法。

ps: 使用這種方式傳引數,在控制台會輸出ognl.nosuchpropertyexception: com.opensymphony.webwork.dispatcher.servletactionredirectresult.objkey異常,這是乙個struts2的乙個bug。

參見——

Struts2 action跳轉時帶引數跳轉

在實現action跳轉到另乙個action時,需要攜帶引數,可以直接在struts.xml配置檔案中對應的跳轉action的地方加上,引數的配置,用ognl表示式,可以從session中取值。如果要傳遞兩個引數,中間用 代替 xml中 要轉義 eg check checkpage.action?ei...

struts2 action 配置方法

struts2 action幾乎完全吸收了xwork 的精華,近日學習struts 2,總結一下action的配製方法。首先看一下com.opensymphony.xwork2.action的介面宣告,action提供execute 方法,子類必須實現execute 方法。public inte c...

struts2 action中result引數詳解

chain 用來處理action鏈 com.opensymphony.xwork2.actionchainresult dispatcher 用來轉向頁面,通常處理jsp org.apache.struts2.dispatcher.servletdispatcherresult freemaker ...