Alexander Grünewald <alexander.gruenewald <at> informus.de> writes:
>
> Hello Jetspeed Community,
>
> is it possible to use a JNDI datasource within a portlet deployed on
> jetspeed 2. The datasource itself seems to work because I can use it in
> a test servlet. But my portlets cann't access it through JNDI. I
> configured the datasource as JNDI resource in the tomcate server.xml
> file. The file $CATALINA_HOME/conf/server.xml therefore contains a
> 'global naming section':
> ...
I would think that you should put the reference to the JNDI data source in the
web.xml of your portlet application, not that of jetspeed and I assume it
*would* be accessible via a JNDI lookup somehow.
I have used a JNDI datasource indirectly in a portlet as I have a data source
set up as you describe and a component that exists as a servlet context
attribute that uses the jndi data source (I instantiate and set up that
component in a ServletContextListener implementation).
I can access my component by using:
request.getPortletSession().getPortletContext().getAttribute("mycomponent");
HTH,
aaron
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]