I got a pretty good idea as to how it works if a someone elses trademark is in a domain name....but what about if it is in the rest of the url, as in www.domain.com/TRADEMARK-widgets.htm Page is made for commercial purpose (selling their product). Can there be any legal consequences?
Let's just say "there isn't supposed to be." But that won't stop some parties from being "anal" about it. I've seen various samples of what you just asked. In all those cases they did rename that portion to avoid trouble. In short, it was more a matter of being pragmatic than legally right.
Technically speaking, URLs do offer search engine benefits. So essentially if you are selling their products, you're gaining extra benefit from having their TM in your URL, because it's helping you place higher in the SERPs and ultimately helping you to profit off of their TM. How this is viewed legally though, I have no idea.
Trademark holders can prohibit the use of their trademark in advertising (like adwords). If you use a trademark in a domain name, they are under no obligation to contact you before suing you, however, most will- in an effort to solve it without legal expense. I think it is extremely unlikely a company is going to sue someone for use in a url without first contacting the party who is actually selling their product. If you are contacted, you can either remove it, or fight it knowing that even if you win, you can run up tens of thousands of dollars in legal fees which you aren't able to recover. Personally, I would go ahead and do it until the unlikely event you are contacted and told to remove it. Practically speaking, you aren't going to want to spend $30K in legal fees proving you were right.