Struts 2 為何把結果放在自定的怪怪地方而不放在 request attribute? 有任何好處嗎?
latest #15
struts 2 的物件仍然有放到 request attribute。只是放在很怪的名稱裡的某個架構。而且把結果放在 request 是 intercepter 做的。應該不影響測試吧?
不是很了解。但這似乎造成 struts 2 不容易結合其他家的 tag library。如 jstl。只能用 struts2 自己的 tah library。而我印象中覺得 jstl 比 struts2 tag library 好。原因我忘了。
嗯。不過,它終究有在 request attribute 裡面放東西,整個 action 都放進去了。這是誰放的呢?
如果這是 interceptor 放的。這個 interceptor 仍然綁死了 jsp request。既然這個 interceptor 能綁死 jsp, 乾脆把 action 的 property 一起放進 request 又何妨呢?
不過話說回來,說不定現在的 struts 2 已經有這種 interceptor, 能把 action property 放進 jsp. 即使沒有,自己做也不難。
back to top