File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes Lookup the url to the web module Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Lookup the url to the web module" Watch "Lookup the url to the web module" New topic
Author

Lookup the url to the web module

Alfred C. Thomas
Greenhorn

Joined: Nov 06, 2006
Posts: 14
Hi

I have an application consisting of EJB and WEB modules on JBoss. I need to find the url to the web module from the EJB side, does anyone know how I can get it? What I tried was to use the contextListener to inject the url, but I couldn't get the context path from the ServletContextEvent object.

Regards
Alfred
[ December 22, 2006: Message edited by: Alfred C. Thomas ]
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

This sounds like an odd requirement. Why are you trying to do this?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Alfred C. Thomas
Greenhorn

Joined: Nov 06, 2006
Posts: 14
Hi Paul

The EJB module sends out e-mails whenever some events occur. I need the url to the web module to be included in the e-mails.

Regards
Alfred
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Do you not have control of where the particular ejb method is called from (i.e. can it be called from anywhere in your web app)? If this is the case, you could just pass the URL with the method call.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Lookup the url to the web module