[prev in list] [next in list] [prev in thread] [next in thread] 

List:       tapestry-user
Subject:    Re: Get application context from within a BasePage subclass
From:       Ulrich_Stärk <uli () spielviel ! de>
Date:       2007-11-20 18:08:11
Message-ID: 4743228B.1090702 () spielviel ! de
[Download RAW message or body]

What version of Tapestry are you referring to? Tapestry 5 doesn't use 
subclasses of BasePage anymore, that's Tapestry 4. But you are trying to 
use T5s spring integration, that is a little bit odd...
Have a look here 
http://www.nabble.com/another-tapestry-4.1.3-archetype-tf4754756.html#a13600914 
for a link to a maven archetype I created which integrates Tapestry 
4.1.3, Spring 2.0.7 and Hibernate. There's also some instructions on how 
to use this archetype.

Cheers,

Uli

Kaspar Fischer schrieb:
> Hi,
> 
> The Tapestry reference,
> 
> 
> http://static.springframework.org/spring/docs/2.0.x/reference/webintegration.html#webintegration-common \
>  
> 
> says that "[...] one can use the following code snippet to get access
> to this 'business context' ApplicationContext created by the
> ContextLoaderListener":
> 
> WebApplicationContext ctx = 
> WebApplicationContextUtils.getWebApplicationContext(servletContext);
> 
> How would I do this from within a page (i.e., a subclass of BasePage)?
> 
> IIUC, a page need not have an associated servletContext. So what sort
> of indirection would I use?
> 
> I am trying to get the Spring WebApplicationContext service that
> (apparently) the tapestry-spring.jar,
> 
> http://tapestry.apache.org/tapestry5/tapestry-spring/
> 
> adds. My finally goal is to load a Spring bean from a page to do
> some processing.
> 
> Many thanks and sorry for the simple question (I am a Tapestry newbie!),
> Kaspar
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic