Re: How to use the EJB module?

heiho1 <[email protected]> Fri, 01 Aug 2003 12:43:08 -0400
Newsgroups gmane.comp.java.jpublish.devel
Message-ID <[email protected]>
Florin,

Thanks for the reply.  This is the info I was looking for however I now 
realize that this module only applies to the Velocity Context...I was 
actually hoping that it would make it possible to globally define 
Session EJBs for the actions.  The reasons for this is that I 
continually have the same code looking up and instantiating EJBs in my 
actions and it would simplify them greatly to have the session beans 
which are being reused constantly available globally in the same manner 
that "request" and "application" are available.

What are the thoughts on this?  Is there a preferable alternative?

Again, thanks!

James

> 
> This simply works:
> 1. in jpublish.xml
> <jpublish>
> 
>         <name>K2 MPrice site</name>
>         <module classname="org.jpublish.module.ejb.EJBModule">
>                 <ejb name="mySessionBean">
>                         <ref>java:comp/env/Example</ref> <!-- I am using 
> Orion -->
>                         
> <home>com.your_package.yourSessionBeanHomeInterface</home>
>                 </ejb>
>         </module>
> 
> ...
> </jpublish>
> 
> 
> 2. expose the session bean to your Page, let's say page1, therefore in 
> /pages/page1.xml you'll add the following:
> ..
>         <page-action name="ejb.exposeSessionBean">
>             <name>mySessionBean</name>
>         </page-action>
> ...
> 
> 3. Then, /content/page1.html, can use the Session Bean :
> ... a result from my SessionBean: <b>$!mySessionBean.aMethod()</b>
> 
> Should work :)
> 
> However you should pay attention to the way you deploy your EJB 
> components. Let us know if you need additional help.
> 
> Regards,
> Florin
> 
> 
> 
> At 7/31/2003 18:07, you wrote:
> 
>> Hello,
>>
>> I am interested in plugging the EJBModule into the my JPublish setup 
>> but I haven't found an example of the configuration file.  I 
>> downloaded the module but there is no example of the XML file.  How do 
>> I configure session beans to be automatically available in JPublish 
>> actions?
>>
>> Thanks for any help,
>>
>> James Richards
>> President, GameJUG.org
>>
>>
>>
>> -------------------------------------------------------
>> This SF.Net email sponsored by: Free pre-built ASP.NET sites including
>> Data Reports, E-commerce, Portals, and Forums are available now.
>> Download today and enter to win an XBOX or Visual Studio .NET.
>> http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 
>>
>> _______________________________________________
>> Jpublish-developer mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/jpublish-developer
> 
> 
> 
> 
> 
> -------------------------------------------------------
> This SF.Net email sponsored by: Free pre-built ASP.NET sites including
> Data Reports, E-commerce, Portals, and Forums are available now.
> Download today and enter to win an XBOX or Visual Studio .NET.
> http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
> _______________________________________________
> Jpublish-developer mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jpublish-developer
> 




-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01