- At 10:38 AM 9/28/2003, Jason Carreira wrote:
- If you don't want to execute the Action, you can just use the ww:bean tag....
ww:bean would not execute the interceptors, which I like and use to populate the Action.
- It would be useful to have all the interceptors executed for a Action associated with a *.jsp. It is not clear to me what values would be placed in an Action via the <ww:param> tag verus an interceptor or IoC, that would not merely be used to populate the directly invoked *.jsp page using <ww:property> and ui tags. If data was needed from somewhere such as a database, it could be implemented as a lazy initialized object in a getter. But so far (not having done much), I have been putting those types of functions in IoC(s) to be cached, or fetched in interceptors and then set into the Action objects.
- Fred.
- Interceptors will not be executed unless the Action is executed. They are executed as part of the execution of the ActionProxy. I'm not sure what you're talking about with the rest of this....
Maybe what I want is a ww:bean tag that does have an associated interceptor-stack executed to set up the bean, but does not have an execute().
Ok, if you have the patience, I do my best to be clear. A *.action will usually be invoked from a form submission or a hyperlink. It usually is commanding that a single something be done, an action: reset the shopping cart, add an item, submit or display an expense report, etc. There are associated values that are embedded in the HTTP URI as parameters or in the POST of the current page.
You could do the same with .jsp page, but that is not the Webwork2 approach which is to specify *.action(s) and leverage the xwork.xml file. Specifying a .jsp with a <ww:action> tag is an unnecessary level of indirection.
So if a .jsp page is used, it will either be a welcome file, or part of a Sitemesh or Tiles component. As a welcome file, there are no parameters, no command, just display a page. A Webwork2 component has not yet executed. There can only be Request or Session data or put there by an interceptor/IoC component which are accessible without using an action parameter. Same thing for Sitemesh; it is running as a Filter. It gets its custom directions back via the decorator pattern on the response (hope I have that right). It is not clear to be how Tiles would integrate with Webwork2, but the individual Tiles would be .jsp(s), no? Not *.action(s).
So far, I am using the interceptors and components to fetch data from the database, usually caching small amounts in memory. If it isn't there, then it is created/fetched/cached/returned/placed in the action, all in the component class.
Fred.