Hi guys,

Anyone know af any "gotchas" re: using this filter in T5? I'm trying to display 
a collection of objects in my page but i'm getting hibernate LazyInitialization 
errors. Here's the relevant code:

Start.tml

            <t:loop source="newPhotos" value="currentPhoto">
                <div class="pic">
                    <img alt="#" src="${currentPhoto.imageResource}" width="64"
                        height="64" />
                    <h2>${photo.name}</h2>
                    By
                    <span>${photo.name}</span>
                </div>
            </t:loop>

Start.java

public class Start
{
    
    @Inject
    @Service("imageService")
    private ImageService imageService;
    
    private Photo currentPhoto;

    public Collection<Photo> getNewPhotos() {
        return imageService.getRecentUploads(5);
    }

    public Photo getCurrentPhoto() {
        return currentPhoto;
    }

    public void setCurrentPhoto(Photo photo) {
        this.currentPhoto = photo;
    }
    
}

web.xml

    <filter>
        <filter-name>app</filter-name>
        <!-- Special filter that adds in a T5 IoC module derived from the 
Spring WebApplicationContext. -->
        <filter-class>
            org.apache.tapestry.spring.TapestrySpringFilter
        </filter-class>
    </filter>

    <filter>
        <filter-name>hibernateFilter</filter-name>
        <filter-class>
            org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
        </filter-class>
    </filter>

    <filter-mapping>
        <filter-name>app</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

    <filter-mapping>
        <filter-name>hibernateFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

And i get:

Render queue error [EMAIL PROTECTED]:could not initialize proxy - the owning 
Session was closed





Reply via email to