This content has been marked as final.
Show 1 reply
-
1. Re: What XDoclet tag to use to get a local JNDI ref in jboss
fwesterop Oct 30, 2005 6:26 PM (in response to fwesterop)Found an alternative solution by using the XDoclet link property of the web.ejb-local-ref tag. XDoclet tags in servlet must be like this:
/** * Servlet Class * * @web.servlet name="Compute" * display-name="Compute" * description="Computes Fibonaci numbers 0..n for a given number n." * * @web.servlet-mapping url-pattern="/Compute" * * @web.ejb-local-ref name="ejb/myFibo" * description = "Reference to a bean that calculates Fibonaci numbers." * type="Session" * local="tutorial.interfaces.FiboLocal" * home="tutorial.interfaces.FiboLocalHome" * link="Fibo" * */ public class ComputeServlet extends HttpServlet { ... }
This results in a <ejb-link> child tag under <ejb-local-ref> in web.xml.
the value of the link property must match the XDoclet name attribute of the ejb.bean tag in the EJB class.
Looks like this way JNDI is not used for lookup (makes sense for a local config) and this is a standard J2EE solution since relevant tags now show up in web.xml instead of jboss-web.xml.