> -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Friday, November 14, 2003 11:07 AM > To: [EMAIL PROTECTED] > Subject: [MERLIN] calling a merlin block from a struts action > > let's say i take the merlin tutorial hello example, and i call it from a > struts action. How would i be obtaining a reference to the hello > component? I have absolutly no idea! > > > Please help! >
I'm jumping into this thread a little late, so this may have been covered, but there are several options: 1. Extend the Struts ActionServlet and Action class to add Avalon handlers. The new ActionServlet would initialize the Avalon container and provide a handle to the container/ServiceManager for your custom Actions. 2. Create a ServletContextListener which initializes an Avalon container (such as Fortress) and puts either the container or the ServiceManager in the ServletContext (which you could then access in your Action) 3. Start up the Avalon container in a new servlet or even in its own separate VM (standalone) and export your components via AltRMI (see exporter in the sandbox). You could then do a JNDI lookup of your components in your Struts action just as you would do a JNDI lookup of an EJB. I know how to do 1 & 2 in Fortress and how to do 3 in Merlin. My personal webserver is down this weekend, but I used to have an example of #2 up there. I think there's something in the mailing list archives about this. J. Aaron Farr SONY ELECTRONICS DDP-CIM (724) 696-7653 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
