tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gurkan Erdogdu <gurkanerdo...@yahoo.com>
Subject Re: Resource Annotation has no effect but JNDI Lookup works (JDBC Resource)
Date Thu, 17 Jun 2010 18:16:44 GMT
Then you have to use 

InitialContext # lookup("java:/comp/env/_Resource_Id_In_your_web_Xml"). 

As we said, if you want to inject dependencies to your classes, those classes must be known
by the container. 

--Gurkan


________________________________
From: marble4u <marco.blevins@energy4u.org>
To: users@tomcat.apache.org
Sent: Thu, June 17, 2010 6:37:56 PM
Subject: Re: Resource Annotation has no effect but JNDI Lookup works (JDBC Resource)


@gurkan & Chris: actually I don't want to use the resource directly in a
servlet or JSP - due to architectural reasons - so is there a way to inject
resources into plain java classes?

@Pid: Thanks for the Information. I will check out the spec and hope that it
is not too much to read ;-)

And thanks a again for all the hints
-- 
View this message in context: http://old.nabble.com/Resource-Annotation-has-no-effect-but-JNDI-Lookup-works-%28JDBC-Resource%29-tp28900220p28916019.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message