users@glassfish.java.net

Embedded Glassfish: Pass parameter from server startup to a web application

From: <glassfish_at_javadesktop.org>
Date: Wed, 13 Oct 2010 12:34:42 PDT

Hi,

two applications are involved in my question:
1) A simple Java Application. It starts an embedded glassfish server (v 3.0.1, using the -web.jar) and deploys a web application.
2) A JSF web application that gets deployed by 1)

The java application uses this code to start the server and deploy the war file: http://java.pastebin.com/GLSFN7zW , so far it works perfectly.

What I would like to do:
I'd like to write / create a parameter (simple String) in the Java application 1) that the web application 2) can read. I'd like to do that as late as possible in the server-startup-and-deployment chain of 1). But I'd be happy if it worked at all, even if it had to be done before server startup.

So far, I tried to set a context-parameter in 1) (thanks for the idea @ #glassfish) this way: http://java.pastebin.com/0nKRSFEq . But that doesn't work, it tells me "INFO: Command set-web-context-param not found"

I'd appreciate any hint on how I could do that.



Thx in advance,


Tiefflieger
[Message sent by forum member 'tiefflieger']

http://forums.java.net/jive/thread.jspa?messageID=485096