/r.jsp?x=${t}
/res.jsp
Result type= |
Forward TO |
Parameters in stack |
”dispatcher” |
View(.jsp) |
Value Stacks: Y Stack Context:Y |
”redirect” |
Action(new action)-View |
Value Stacks: N Stack Context:Y |
”chain” |
Action-action-View (Value stack:Paramx2) |
Value Stacks: Y Stack Context:Y |
總結:dispatcher 直接跳轉到view界面,默認type=dispatcher
redirect 跳轉會產生一個新的線程,
struts會new 兩個action出來,
原action調用class時保存在value stack中的參數在結果頁面是無法調出的,
結果頁面只能通過stack context調出redirect傳過來的參數
chain 跳轉是直接跳轉到另外一個action上,
等於經過了兩個action 和result,
在value stack中原始action中的param會保留,
新action中是否保留取決於新action的result type,
結果頁面一定會顯示原始valuestack中的param。