回复: can i override freemarker template

2011-08-01 Thread Yonder
Thanks I've test it.The classpath will be searched first. So I need another solution. > >发件人: Dave Newton >收件人: Struts Users Mailing List ; Yonder > >发送日期: 2011年8月1日, 星期一, 下午 7:27 >主题: Re: can i override freemarker template > > >I don't recall which will be searc

RE: Where to put non action associated data

2011-08-01 Thread Marcus Bond
Thanks for the feedback.. my first thought was to use interceptors but I decided against this since in principle I mainly use interceptors for stuff like setting up ThreadLocals for the request, auditing requests and for access control etc. but not for business logic. Action chaining also entered m

Re: Where to put non action associated data

2011-08-01 Thread Dave Newton
Yep, a service is the canonical solution--my impression was that the OP was trying to avoid *any* knowledge of the additional search stuff, but composing capabilities via services sure seems like the easiest thing to do. Dave On Mon, Aug 1, 2011 at 9:32 AM, Aaron Brown wrote: > If I were coding

Re: Where to put non action associated data

2011-08-01 Thread Aaron Brown
If I were coding the search part, I'd probably place the secondary piece inside a searching business service. Your action would instantiate a search business service and ask it to get search results based on a query string. The business service would do that and also (based on whatever business log

Re: Destroy an Action in Struts2?

2011-08-01 Thread JOSE L MARTINEZ-AVIAL
Well, I don't have an issue with memory leaks now, and it's been a while since I had some problem with it(but it was due to some references in a list not cleaned).. It maybe a 'cargo cult', but I don't think it is harmful,-apart from some overhead- so I just prefer to be on the safe side. A little

Re: Where to put non action associated data

2011-08-01 Thread Dave Newton
Meh, while I think turning this into something event-based is way overkill, I wouldn't turn to chaining, either. I'd probably just use an interceptor, AOP, or any other "around"-type solution. I view actions as something a user can hit (insert mom-joke here), not as a chunk of general-purpose func

Re: Destroy an Action in Struts2?

2011-08-01 Thread Dave Newton
Unless you have proof an action's properties are causing a memory leak, it sounds like "cargo cult" programming to me. Most cases if leaks like this are caused by something else in the code keeping references. Have you profiled the app to see if what you want is really necessary? I'm pretty skepti

Re: can i override freemarker template

2011-08-01 Thread Dave Newton
I don't recall which will be searched first, or if it will even search both. I've probably just try it. That said, if this type of customization is a feature of the application, I've strongly consider a cleaner solution, like serving the templates from a database, or providing a clear, consistent

can i override freemarker template

2011-08-01 Thread Yonder
Dear all, I'm using struts 2.2.3 and conversion plugin. I have set the struts.convention.result.path to '/WEB-INF/views' and I know the convension plugin will searching for results in the Servlet container and in the class path. So can I put the default result template in classpath and if need,

Re: Destroy an Action in Struts2?

2011-08-01 Thread JOSE L MARTINEZ-AVIAL
Well, the interceptor should be the first one on the stack, so all data required in the result should have been already used. It's not a bad idea, I will work with that. With respect to the GC, back in 2002 when I started using Java the GC didn't work quite well, and my team and I started clearing

Re: Destroy an Action in Struts2?

2011-08-01 Thread Maurizio Cucchiara
Doing what you are looking for through an interceptor is quite trivial: you should simply check (after the invocation.invoke() call) if an action implements Destroyable IF and then call the destroy method. Anyway, I think that the garbage collector in this specific case is able to do a good work,