Hello!

Thank you for reply!

How developers pass parameters to their web applications? There are several
ways of doing it. One of them is: put parameters to web.xml as Environment
entry. It is very convinient.

But it appears that I can change this value in admin application. And this
change is not visible in JNDI :-(
I have to restart tomcat to see new parameters ... or change them in admin
and reload contex.

Maybe it is of no importance for others, but I really care :-)
I made some researches and I think, that
org.apache.catalina.core.NamingContextListener class should be corrected:

it was:

public void lifecycleEvent(LifecycleEvent event) {
...
            // Binding the naming context to the class loader
            if (container instanceof Context) {
                // Setting the context in read only mode
                ContextAccessController.setReadOnly(getName());
                try {
                    ContextBindings.bindClassLoader
                        (container, container,
                         ((Container)
container).getLoader().getClassLoader());
                } catch (NamingException e) {
                    log(sm.getString("naming.bindFailed", e));
                }
            }
...
}

I think, it should be:


public void lifecycleEvent(LifecycleEvent event) {
...
            // Binding the naming context to the class loader
            if (container instanceof Context) {



               namingResources.addPropertyChangeListener(this);



                // Setting the context in read only mode
                ContextAccessController.setReadOnly(getName());
                try {
                    ContextBindings.bindClassLoader
                        (container, container,
                         ((Container)
container).getLoader().getClassLoader());
                } catch (NamingException e) {
                    log(sm.getString("naming.bindFailed", e));
                }
            }
...
}


With this modification changes in Admin application are visible in JNDI.

Could you please tell you opinion - is this modification ok?

Thank you,
Igor

----- Original Message -----
From: "Shapira, Yoav" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <[EMAIL PROTECTED]>
Sent: Friday, October 22, 2004 4:13 PM
Subject: RE: Environment entries question



Hi,
I think there's been an open bugzilla issue for this for months.  It's
such a marginal use-case that (as evidenced by the fact no one's done it
for months) no one seems to care, given the two workarounds in your
post.  So if you really care, maybe you could submit a patch?

Yoav Shapira http://www.yoavshapira.com


>-----Original Message-----
>From: Igor [mailto:[EMAIL PROTECTED]
>Sent: Friday, October 22, 2004 3:25 AM
>To: [EMAIL PROTECTED]
>Subject: Environment entries question
>
>Hello!
>
>I created environment entry in web.xml:
>
>    <env-entry>
>        <env-entry-name>test</env-entry-name>
>        <env-entry-value>simple test</env-entry-value>
>        <env-entry-type>java.lang.String</env-entry-type>
>    </env-entry>
>
>This entry is used in the following way:
>
>    Context initCtx = new InitialContext();
>    Context envCtx = (Context) initCtx.lookup("java:comp/env");
>    String value = (String) envCtx.lookup("test");
>
>Then I tried to change this environment entry using admin application.
It
>was changed correctly in admin application, but code, listed above,
returns
>old value.
>
>I know two ways of how to make this code know of new value:
>
>1. Change it in web.xml and restart tomcat
>2. Change it in admin application and reload corresponding context
>
>I do not like both of these ways.
>
>Could somebody please tell me - is there a way of changing environment
>entry value, so that code, described above will see new value?
>
>Thank you in advance,
>Igor



This e-mail, including any attachments, is a confidential business
communication, and may contain information that is confidential, proprietary
and/or privileged.  This e-mail is intended only for the individual(s) to
whom it is addressed, and may not be saved, copied, printed, disclosed or
used by anyone else.  If you are not the(an) intended recipient, please
immediately delete this e-mail from your computer system and notify the
sender.  Thank you.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to