lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Moore <>
Subject Re: Struts2 implementation
Date Tue, 06 Oct 2009 22:58:07 GMT
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.

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:
For additional commands, e-mail:

View raw message