Issue Details (XML | Word | Printable)

Key: TAPESTRY-774
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Jesse Kuhnert
Reporter: Scott Russell
Votes: 1
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Tapestry

PopupLinkRenderer fails in Form rewind

Created: 25/Nov/05 02:53 PM   Updated: 30/Apr/06 04:53 PM
Return to search
Component/s: Contrib
Affects Version/s: 4.0
Fix Version/s: 4.0.1, 3.0.5, 4.1

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works TAPESTRY-774-branch-3.0.patch 2006-03-15 01:01 PM Brian K. Wallace 0.9 kB
Text File Licensed for inclusion in ASF works TAPESTRY-774-trunk.patch 2006-03-15 01:01 PM Brian K. Wallace 1 kB

Resolution Date: 17/Mar/06 11:14 PM


 Description  « Hide
Tapestry version 4.0 beta13

I have a DirectLink component, with a PopupLinkRenderer, embedded within a
Form. Upon Form submit, I get an error during Form rewind as follows:

"Component booking/Booking/chooseSenderLink requires rendering support, but no
PageRenderSupport object has been stored into the request cycle. This object
is typically provided by a Body component. You should add a Body component to
your template."

I have a Body component around the whole page, but it does not seem to render during Form rewind.
As a result, when the PopupLinkRenderer renders, it complains about not having a
Body component supplying PageRenderSupport.

It seems that DirectLink and/or PopupLinkRenderer should be checking for Form rewind and not rendering in that case.


The full exception is as follows:

org.apache.tapestry.TapestryUtils.getPageRenderSupport(TapestryUtils.java:108)
org.apache.tapestry.contrib.link.PopupLinkRenderer.constructURL(PopupLinkRenderer.java:68)
org.apache.tapestry.link.DefaultLinkRenderer.renderLink(DefaultLinkRenderer.java:62)
org.apache.tapestry.link.AbstractLinkComponent.renderComponent(AbstractLinkComponent.java:95)
org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:617)
org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:434)
org.apache.tapestry.form.FormSupportImpl.rewind(FormSupportImpl.java:548)
org.apache.tapestry.form.Form.renderComponent(Form.java:226)
$Form_698.renderComponent($Form_698.java)
org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:617)
org.apache.tapestry.form.Form.rewind(Form.java:327)
org.apache.tapestry.engine.RequestCycle.rewindForm(RequestCycle.java:442)
org.apache.tapestry.form.Form.trigger(Form.java:338)
org.apache.tapestry.engine.DirectService.triggerComponent(DirectService.java:146)
org.apache.tapestry.engine.DirectService.service(DirectService.java:132)
$IEngineService_107c5b11bbe.service($IEngineService_107c5b11bbe.java)
org.apache.tapestry.services.impl.EngineServiceOuterProxy.service(EngineServiceOuterProxy.java:65)
org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java:248)
org.apache.tapestry.services.impl.InvokeEngineTerminator.service(InvokeEngineTerminator.java:60)
$WebRequestServicer_107c5b11b97.service($WebRequestServicer_107c5b11b97.java)
org.apache.tapestry.services.impl.DisableCachingFilter.service(DisableCachingFilter.java:48)
$WebRequestServicerFilter_107c5b11b99.service($WebRequestServicerFilter_107c5b11b99.java)
$WebRequestServicer_107c5b11b9b.service($WebRequestServicer_107c5b11b9b.java)
$WebRequestServicer_107c5b11b93.service($WebRequestServicer_107c5b11b93.java)
org.apache.tapestry.services.impl.WebRequestServicerPipelineBridge.service(WebRequestServicerPipelineBridge.java:56)
$ServletRequestServicer_107c5b11b77.service($ServletRequestServicer_107c5b11b77.java)
org.apache.tapestry.request.DecodedRequestInjector.service(DecodedRequestInjector.java:55)
$ServletRequestServicerFilter_107c5b11b73.service($ServletRequestServicerFilter_107c5b11b73.java)
$ServletRequestServicer_107c5b11b79.service($ServletRequestServicer_107c5b11b79.java)
org.apache.tapestry.multipart.MultipartDecoderFilter.service(MultipartDecoderFilter.java:52)
$ServletRequestServicerFilter_107c5b11b71.service($ServletRequestServicerFilter_107c5b11b71.java)
$ServletRequestServicer_107c5b11b79.service($ServletRequestServicer_107c5b11b79.java)
org.apache.tapestry.services.impl.SetupRequestEncoding.service(SetupRequestEncoding.java:53)
$ServletRequestServicerFilter_107c5b11b75.service($ServletRequestServicerFilter_107c5b11b75.java)
$ServletRequestServicer_107c5b11b79.service($ServletRequestServicer_107c5b11b79.java)
$ServletRequestServicer_107c5b11b6b.service($ServletRequestServicer_107c5b11b6b.java)
org.apache.tapestry.ApplicationServlet.doService(ApplicationServlet.java:123)
org.apache.tapestry.ApplicationServlet.doPost(ApplicationServlet.java:168)
javax.servlet.http.HttpServlet.service(HttpServlet.java:616)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:428)
org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:830)
net.sf.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:292)
net.sf.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:84)
net.sf.acegisecurity.intercept.web.SecurityEnforcementFilter.doFilter(SecurityEnforcementFilter.java:182)
net.sf.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
net.sf.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:153)
net.sf.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
net.sf.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:305)
net.sf.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
net.sf.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:225)
net.sf.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
net.sf.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:173)
net.sf.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:125)
org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821)
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:174)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821)
org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:471)
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:568)
org.mortbay.http.HttpContext.handle(HttpContext.java:1565)
org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:633)
org.mortbay.http.HttpContext.handle(HttpContext.java:1517)
org.mortbay.http.HttpServer.service(HttpServer.java:954)
org.mortbay.http.HttpConnection.service(HttpConnection.java:816)
org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:983)
org.mortbay.http.HttpConnection.handle(HttpConnection.java:833)
org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)

-Scott

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Mikaël Cluseau added a comment - 09/Dec/05 08:04 PM
I hit it too. The fix is trivial. In Tapestry, change the

org.apache.tapestry.contrib.link.PopupLinkRenderer.constructURL(link, cycle)

to read, at the beginning:

if (cycle.isRewinding()) {
    return null;
}

You may also simply fix it in your project by subclassing PopupLinkRenderer and overriding the method:

public String constructURL(ILinkComponent link, IRequestCycle cycle) {
    if (cycle.isRewinding()) {
        return null;
    }
    return super.constructURL(link, cycle);
}

Brian K. Wallace added a comment - 15/Mar/06 01:01 PM
This issue affects 3.X as well as 4.X

Added check for cycle.isRewinding() to return null.

Jesse Kuhnert added a comment - 17/Mar/06 10:47 PM
Applied to 3.0 branch.

Jesse Kuhnert added a comment - 17/Mar/06 11:14 PM
Patches applied.