Offering JNDI resources via java:comp/env is per the servlet spec.  I
suppose you could implement a ServletContextListener to do whatever
magic you are looking for.  I'm left wondering though, why you
absolutely need the JNDI stuff to be offered as java:MyDS?  Sounds like
you are in control of the source code ... couldn't you just use the full
JNDI path as provided?

--David

Александър Шопов wrote:
> Hi guys,
> In my webap I am using a library that depends on datasources being
> mapped to:
> java:MyDS and not java:comp/env/jdbc/MyDS
>
> When I define datasources in Tomcat, they end in java:comp/env.
>
> What can I do to remap the datasources - make them available as
> java:MyDS?
>
> One of the strategies would be to have a servlet that initializes before
> the rest of the system and do additional binding that would hopefully be
> available to later loaded servlets.
>
> Another one is to change the implementation of Context that new
> InitialContext() returns, however I am not aware how and where to
> implement this.
>
> Can anyone suggest a solution?
>
> Kind regards:
> al_shopov
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to