You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by DG...@EvergreenInvestments.com on 2006/03/16 17:02:40 UTC

[OT ]Re: obtaining server URL (or ip and port) from plugin

Assuming all of the "slaves" know the id of the "master", then maybe you 
have a RegisterServlet that's called by a slave processing servers during 
their init? http://javaalmanac.com/egs/javax.servlet/GetReqUrl.html

-Dennis




Wojciech Ciesielski <wc...@f1.pl> 
03/16/2006 10:52 AM
Please respond to
"Struts Users Mailing List" <us...@struts.apache.org>


To
Struts Users Mailing List <us...@struts.apache.org>
cc

Subject
Re: obtaining server URL (or ip and port) from plugin







>>
>> I need to find URL to my application 
>> (http://myhost:8080/myAppContext) from within init() method of struts 
>> plugin (implementing PlugIn interface). Any ideas how can I do this 
>> programatically without specifying it explicitly in one of 
>> application configuration files?
> You can't do it, in any part of your web-app! But what do you need 
> your application URL for?
> Ciao
> Antonio
We are trying to create distributed computing environment based on 
web-apps with one master server where multiple processing servers 
register themselves. Communication is done by calling action via HTTP. 
And therefore I have to let master server know about URL of processing 
server interface...

Wojtek

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org



Re: [OT ]Re: obtaining server URL (or ip and port) from plugin

Posted by Dave Newton <ne...@pingsite.com>.
DGraham@EvergreenInvestments.com wrote:
> Did you even _LOOK_ at the url that I sent the first time?  Your slave 
> starts and fires init() and makes a call to the master, the master will 
> take the request and reconstruct the URL from the slave.
>   

How does this help? This is the URL that the slave requested; the OP
needs to know where the request came from--the _slave's_ hostname and port.

The port is the killer, AFAICT; I'm not sure if getRemoteHost includes
that, or if it did, if it would be useful since the port used to make
the request wouldn't be the post the server would _answer_ requests on.

Dave




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [OT ]Re: obtaining server URL (or ip and port) from plugin

Posted by DG...@EvergreenInvestments.com.
Did you even _LOOK_ at the url that I sent the first time?  Your slave 
starts and fires init() and makes a call to the master, the master will 
take the request and reconstruct the URL from the slave.

Posted again JUST IN CASE: 
http://javaalmanac.com/egs/javax.servlet/GetReqUrl.html

-Dennis





Wojciech Ciesielski <wc...@f1.pl> 
03/16/2006 11:14 AM
Please respond to
"Struts Users Mailing List" <us...@struts.apache.org>


To
Struts Users Mailing List <us...@struts.apache.org>
cc

Subject
Re: [OT ]Re: obtaining server URL (or ip and port) from plugin








DGraham@EvergreenInvestments.com wrote:
> Assuming all of the "slaves" know the id of the "master", then maybe you 

> have a RegisterServlet that's called by a slave processing servers 
during 
> their init? http://javaalmanac.com/egs/javax.servlet/GetReqUrl.html
>
> -Dennis
> 
The problem is that slaves know master's URL but master also needs to 
know URL of slave server because it calls their methods (like 
http://myslave:8080/myProcessingApp/process.do) with tasks to process. 
And I can't find a good way to determine URL of slave servers :-/

Wojtek


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org



Re: [OT ]Re: obtaining server URL (or ip and port) from plugin

Posted by Wojciech Ciesielski <wc...@f1.pl>.

DGraham@EvergreenInvestments.com wrote:
> Assuming all of the "slaves" know the id of the "master", then maybe you 
> have a RegisterServlet that's called by a slave processing servers during 
> their init? http://javaalmanac.com/egs/javax.servlet/GetReqUrl.html
>
> -Dennis
>   
The problem is that slaves know master's URL but master also needs to 
know URL of slave server because it calls their methods (like 
http://myslave:8080/myProcessingApp/process.do) with tasks to process. 
And I can't find a good way to determine URL of slave servers :-/

Wojtek


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org