[jboss-user] [Tomcat, HTTPD, Servlets & JSP] - Re: JSTL sql:setDataSource and JCA

cascadia4u do-not-reply at jboss.com
Mon Jul 9 19:33:03 EDT 2007


I finally figured out that JBoss does not conform to the J2EE standard for storing the DataSource references in their JNDI repository.  I don't remember at the moment what the standard is (something like java.env:DataSourceName), but it is not referenceable as java:DataSourceName.

So, I registered it within the ServletContext as a variable during startup in the ContextListener:
dataSource = (DataSource) initialContext.lookup("java:asa");
servletContext.setAttribute("asa", dataSource);

Then I was able to reference it in the JSP as:
<sql:setDataSource dataSource="${asa}" />

That seemed to do the trick.

I hope that helps!

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4062207#4062207

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4062207



More information about the jboss-user mailing list