Search code examples
cookiesstrutsbusiness-logicrule-engine

Showing different pages to different users


I need to design a system in a website to display different pages to different users based on multiple rules:

  1. If the user's visit is organic, direct hit to the homepage, show /url1
  2. If the user's visit is not organic like he was referred from a blog, show /url2
  3. If the user wants to shop, but isnt logged in, show /url3

How do I achieve this?!


Solution

  • You can do this with something as simple as if statements and redirects in Java code within your Struts actions.

    You can use something as complex as JBoss Drools Guvnor, if the rules are very complex and the permutations are unmanageable in an if statements, or the rules need to be dynamically controlled by business users.

    http://www.jboss.org/drools/drools-guvnor.html