|
From: J.Enrique Ruiz-V. <er...@di...> - 2005-06-02 09:35:12
|
Hi Keith, we have developed a tag to put a bean in one scope of the
view. I have attached it, and I hope it will be what you need.
Usage example:
ApplicationContext:
<bean id="myBean" class="...">
...
</bean>
JSP View:
<%@ taglib prefix="dco" uri="http://www.disid.com/tags/dco" %>
<dco:defineBean name="myBean" var="mb" />
<c:out value="${mb.property}" />
>Juergen,
>
>I should clarify: I meant from a view template like a .jsp, not a mvc View
>instance. Basically I have some beans in a flow-scoped application context.
>Because the AC is in flow scope, I can access it like this from view
>resources participating in the flow. Ideally I'd like to be able to invoke
>arbitrary methods on certain beans, like this:
>
>${transactionContext.transactionCoordinator.amountDeposited}, which would
>translate to: ac.getBean("transactionCoordinator").getAmountDeposited().
>
>Keith
>
>-----Original Message-----
>From: spr...@li...
>[mailto:spr...@li...] On Behalf Of
>Juergen Hoeller
>Sent: Wednesday, June 01, 2005 2:58 PM
>To: spr...@li...
>Subject: Re: [Springframework-developer] am I missing something
>
>Keith,
>
>If you define your View instances as beans (using XmlViewResolver or
>ResourceBundleViewResolver), you can wire them with anything you want, using
>standard Spring bean references.
>
>However, if you're using a UrlBasedViewResolver, this is not available
>because of the different View instantiation model there. You can do
>ApplicationContext lookups in an ApplicationContextAware view, though.
>
>What concretely do you want to pass to a View instance?
>
>Juergen
>
>
>-----Original Message-----
>From: spr...@li...
>[mailto:spr...@li...]On Behalf Of
>Keith Donald
>Sent: Wednesday, June 01, 2005 2:31 AM
>To: spr...@li...
>Subject: [Springframework-developer] am I missing something
>
>
>Is there an easy way to invoke methods on a bean exported in the Spring
>application context from a view? It'd be quite useful for this app I'm
>building. I reckon I could just stick the service I want to expose into the
>model but it'd be cool to have the whole context in there in this case.. I
>know we also want this capability in web flow definitions as well.
>
>Keith
>
>
>
>
>
>-------------------------------------------------------
>This SF.Net email is sponsored by Yahoo.
>Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
>Search APIs Find out how you can build Yahoo! directly into your own
>Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
>_______________________________________________
>Springframework-developer mailing list
>Spr...@li...
>https://lists.sourceforge.net/lists/listinfo/springframework-developer
>
>
>
>-------------------------------------------------------
>This SF.Net email is sponsored by Yahoo.
>Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
>Search APIs Find out how you can build Yahoo! directly into your own
>Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
>_______________________________________________
>Springframework-developer mailing list
>Spr...@li...
>https://lists.sourceforge.net/lists/listinfo/springframework-developer
>
>
>
--
J.Enrique Ruiz-Valenciano
CIO, DiSiD S.L.L. (http://www.disid.com)
Email: er...@di...
|