> Please, see me as a newbie and give me some code!
> a) Explain if there is really working possibility to
> have J2EE datasource in cocoon's web.xml alone so one
> could access it directly or is it bad idea as such?
if you deploy cocoon.war inside your application's .ear file you'll see everything, even EJBs, not to mention datasources.
when cocoon is deployed on your appserver, you can get an InitialContext of the JNDI server even easier, if it was a standalone app. I simply don't see a problem at all. I didn't have a necessity to call EJBs from Cocoon components yet, but I don't see any technical issues here.
There could be issues with exception handling, as Arthur mentioned. When XSP is compiled, it has to handle all exceptions. So, Arthur wrote that it's better to make EJB calls before rendering the page, in order to be able to dispatch the request to other pages when errors come. Otherwise, it's not a big deal to call EJB from inside Cocoon. sorry, no code attached :)