Yes, I'm injecting the service now and it works fine. My head is not completely around struts2 yet but there would seem to be considerable advantage to the interceptor/plug-in approach, not the least of which is you wouldn't have to write an action class each time you need to drop search results on the ValueStack. IOW, view programmers would only need to understand a results object -- homegrown, Solr response, whatever -- and not how to get it.

An analogous case is where each action class in my struts1 apps is responsible for fiddling with a session breadcrumb but in struts2 I'm using an interceptor and plugin to make the breadcrumb data automagically available to the view. It's really quite slick and it would be kind of cool to expose Lucene in a similar way. But, I've still got a lot to learn about struts2.
-Gary

Dave Newton wrote:
I'm not sure why an interceptor would be a good choice (or a plugin, for that 
matter). If the search code is well-isolated just make it a service. Then 
inject it into the action via any mechanism.

Dave




---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org

Reply via email to