struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron Brown <>
Subject Re: Where to put non action associated data
Date Mon, 01 Aug 2011 13:32:32 GMT
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 logic you like) would do whatever extra
things were appropriate. The action never knows or cares about it, and
your low-level data access piece doesn't know either. It's the service
layer's job to understand the complexities and related activities that
go with the basic requests from the Action.

My two cents.

 - Aaron

On Sun, Jul 31, 2011 at 12:50 PM, Marcus Bond <> wrote:
> Hi,
> Say I have a form where user can carry out a product search which hits an
> action and returns a list of results - easy.. however in response to the
> user changing their search criteria I want to also generate some search
> terms which would be passed through to Ebay, google ads etc.. but not within
> my action which is designed with one purpose in mind - to search my db (the
> action doesn't know about google ads, ebay, AWS or any other thing that
> comes along). Gut reaction here is to fire an event (say product changed)
> and have some listeners do the work of generating the relevant google / ebay
> stuff and storing this in the users session.
> Firstly, is this how most of you would go about it?
> Secondly in terms of the view side of things, whilst normally my action
> would simply return 'success' I may want to tweak the view depending upon
> which external source returned the best results (currently I use tiles but I
> don't think I can or should dynamically switch the result after my action
> has processed).. How would you tackle this? By adding logic to the tile /
> template jsp or some other means?
> Can any of you share experiences of using Struts in apps like this and how
> you tackled similar scenarios or if maybe another framework is more suited?
> You'll have to bear with me here since all my work thus far has had no need
> to collaborate data from multiple sources in one page.
> Regards and thanks in advance,
> Marcus

Aaron Brown :

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message