Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Lucene: Java-User

Struts2 implementation

 

 

Lucene java-user RSS feed   Index | Next | Previous | View Threaded


gary at littlebunch

Oct 6, 2009, 8:47 AM

Post #1 of 3 (798 views)
Permalink
Struts2 implementation

I'm porting one of my Struts1 Lucene search apps to Struts2. The
basics are working but I need to remove the Lucene search service out of
the action classes. I'm ready to write an interceptor but can perhaps
also see using a plug-in like is done with Tiles. As I'm a Struts2
newbie, any tips/advice from anyone's experiences would be appreciated.
Thanks
Gary


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
For additional commands, e-mail: java-user-help [at] lucene


newton.dave at yahoo

Oct 6, 2009, 11:34 AM

Post #2 of 3 (750 views)
Permalink
Re: Struts2 implementation [In reply to]

> I'm porting one of my Struts1 Lucene search apps to Struts2. The basics are

> working but I need to remove the Lucene search service out of the action
> classes. I'm ready to write an interceptor but can perhaps also see using a
> plug-in like is done with Tiles. As I'm a Struts2 newbie, any tips/advice from
> anyone's experiences would be appreciated. Thanks

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-unsubscribe [at] lucene
For additional commands, e-mail: java-user-help [at] lucene


gary at littlebunch

Oct 6, 2009, 3:58 PM

Post #3 of 3 (744 views)
Permalink
Re: Struts2 implementation [In reply to]

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-unsubscribe [at] lucene
For additional commands, e-mail: java-user-help [at] lucene

Lucene java-user RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.