|
From: Solomon D. <sd...@gm...> - 2008-10-08 21:29:09
|
Re ResourceExposingService - I guess it was a bad name... I basically meant
ResteasyRegistration. I do hope this makes it into the RESTEasy core.
Re IoC container dependency: What I really want is a way to use the Spring
MVC framework right along side JAX-RS/RESTEasy. It will allow me to
configure which requests go to Spring MVC Controllers/Struts Actions/JAX-RS
Resources and how to render Views/Producers with
Velocity/Freemarker/Tiles/JSP. In order to get that to work properly, I'll
need to store the Registry et al in the Spring Application context instead
of the ServletContext.
Perhaps I'll just vet some ideas in this group as to how I could use
RESTEasy towards my ends. The means I use to achieve my ends may may be
helpful for other MVC and IoC integrations such as Struts2/Guice... I know
RESTEasy already works with Seam ;).
-Solomon
On Wed, Oct 8, 2008 at 4:16 PM, Bill Burke <bb...@re...> wrote:
> We wouldn't need a ResourceExposingService. That is the Registry. I see
> your point of the same class instantiated as different beans, but having the
> same relative resource API.
>
> Maybe something as simple as:
>
> public class ResteasyRegistration
> {
> String getRootPath();
> Object getTarget();
> }
>
>
>
> <bean name="MyBean" class="org.any.MyService"/>
> <bean name="MyBean2" class="org.any.MyService"/>
>
> Leave out the @Path annotation on the MyService class.
>
> <bean name="registration" class="org.jboss.resteasy.ResteasyRegistration">
> <property name="rootPath">/x/1</property>
> <property name="target" ref="MyBean"/>
> </bean>
>
> <bean name="registration2" class="org.jboss.resteasy.ResteasyRegistration">
> <property name="rootPath">/x/2</property>
> <property name="target" ref="MyBean2"/>
> </bean>
>
> Then we just modify the Spring adapter to look for instances of
> ResteasyRegistration.
>
>
> Solomon Duskis wrote:
>
>> 2) Having RestEasy configured purely in spring, including
>> configuration/management of the Registry and Dispatcher in Spring - I'll
>> fill in this idea in a future email.
>>
>>
> I don't want to be dependent on any IoC container. There are a bunch out
> there: Spring, Seam, Guice, JBoss MC, and even Java EE to some degree.
> This is why I've focused on configuration via web.xml context-params.
>
>
>
> --
> Bill Burke
> JBoss, a division of Red Hat
> http://bill.burkecentral.com
>
|