Results 1 to 2 of 2

Thread: Generating web URL from business layer

  1. #1
    Join Date
    Aug 2004
    Location
    Wellington, New Zealand
    Posts
    31

    Default Generating web URL from business layer

    I need to send emails after certain events in my application, and in those emails include a URL that points to an application URL. For example, when a user registers for an account, I send them an email with a confirmation URL in it so they can activate the account. The emails are sent via a method interceptor on the business layer.

    My question is: what is the best way to access the web-context specific information from the business layer? I would like not to have to code in the web context or web controller if possible. Currently I just use a property like

    my.url=http://foo.bar/thing

    but wondered if there was perhaps a better way?
    -- m@

  2. #2
    Join Date
    Aug 2004
    Location
    Toronto, Canada
    Posts
    736

    Default

    I think the cleanest way is for your web layer to pass in the URL down to your service/business layer. Your business layer knows nothing about anything above it, after all...

    But I wouldn't hard-code the host, port, context etc. The web layer should just get these from the current request, and then tack on a context relative portion which is a property being set in the appcontext.
    Colin Sampaleanu
    SpringSource - http://www.springsource.com

Similar Threads

  1. Spring-based architectural approach
    By diegum in forum Architecture
    Replies: 9
    Last Post: May 10th, 2007, 04:09 PM
  2. Replies: 2
    Last Post: Oct 10th, 2005, 05:12 PM
  3. Beandoc crashing (on its samples!)
    By aaime in forum Container
    Replies: 17
    Last Post: Oct 7th, 2005, 07:21 AM
  4. About business layer : manager and domain
    By ndeloof in forum Architecture
    Replies: 6
    Last Post: Mar 4th, 2005, 10:01 AM
  5. Securing presentation or business layer? Arguments?
    By Andreas Schildbach in forum Security
    Replies: 1
    Last Post: Feb 10th, 2005, 01:06 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •