Markus Karg wrote:
>
> I have an EAR. It contains a standalone Swing client to be run in ACC,
> and a servlet to be run on the host. The Swing client wants to access
> the servlet using simple URL().getContent(). So the client needs to
> know the hostname or IP address of the host. Since it was a single
> deploy action of one EAR in theory ACC could know that hostname or
> address. But is there a "clean" way (i. e. no special GlassFish
> tricks) how my client can ask the ACC for this address? Or do I have
> to manually set some deployment descriptor environment entries?
>
There is no standard Java EE way for the client code to get this
information. There is not even a good GlassFish-specific way (at least
none I can think of) to do this reliably.
I would think you would not want to build this information into the
deployment descriptor because that means the descriptor would need to
change as the app is deployed to different systems.
One option: pass the servlet's URL as a command-line argument to the
client. The ACC itself will not do anything with it except pass it on
to the client logic which can do what it wants with the data.
Another possibility: Deploy a web service and access the web service
instead of the servlet from the client. You can then take advantage of
injection to resolve the web service address. Just a thought.
- Tim
>
>
>
> Thanks!
>
> Markus
>
>
>
> QUIPSY QUALITY GmbH & Co. KG
>
> Ein Unternehmen der MES-Gruppe
>
> Stuttgarter Strasse 23
>
> D-75179 Pforzheim
>
> Tel: 07231-9189-52
>
> Fax: 07231-9189-59
>
> www.quipsy.de <http://www.quipsy.de>
>
> karg_at_quipsy.de <mailto:karg_at_quipsy.de>
>
> Registergericht Mannheim HRA 701214
>
> Geschäftsführer: Nils Schroeder
>
>
>
> Diese E-Mail enthält persönliche, vertrauliche und vor Weitergabe
> geschützte Informationen und ist ausschließlich für den vorgesehenen
> o.g. Empfänger (Adressaten) bestimmt. Falls Sie diese E-Mail
> versehentlich erhalten haben und nicht der vorgesehene Empfänger sind,
> bitten wir Sie, die E-Mail und deren Anhänge nicht aufzubewahren,
> nicht zu vervielfältigen, nicht zu nutzen und nicht weiterzugeben.
> Bitte informieren Sie uns als Absender über diesen Zustellungsfehler
> und löschen Sie die E-Mail.
>
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>