PageRenderLinkSource not usable in HttpServletRequestHandler?

2010-04-14 Thread Geoff Callender
It seems PageRenderLinkSource.createPageRenderLink(..) can't be used in an 
HttpServletRequestHandler because it results in NullPointerException. I'm using 
T5.1.0.5.

Can anyone confirm this? (and perhaps give a good alternative?)

java.lang.NullPointerException
at $Request_127fc1c71ae.getContextPath($Request_127fc1c71ae.java)
at $Request_127fc1c714e.getContextPath($Request_127fc1c714e.java)
at 
org.apache.tapestry5.internal.services.ComponentEventLinkEncoderImpl.createPageRenderLink(ComponentEventLinkEncoderImpl.java:115)
at 
$ComponentEventLinkEncoder_127fc1c7176.createPageRenderLink($ComponentEventLinkEncoder_127fc1c7176.java)
at 
org.apache.tapestry5.internal.services.LinkSourceImpl.createPageRenderLink(LinkSourceImpl.java:107)
at 
$LinkSource_127fc1c719d.createPageRenderLink($LinkSource_127fc1c719d.java)
at 
org.apache.tapestry5.internal.services.PageRenderLinkSourceImpl.createPageRenderLink(PageRenderLinkSourceImpl.java:45)
at 
org.apache.tapestry5.internal.services.PageRenderLinkSourceImpl.createPageRenderLink(PageRenderLinkSourceImpl.java:40)
at 
$PageRenderLinkSource_127fc1c715e.createPageRenderLink($PageRenderLinkSource_127fc1c715e.java)
at 
jumpstart.web.services.AssetProtectionFilter.service(AssetProtectionFilter.java:49)
at 
$HttpServletRequestHandler_127fc1c7163.service($HttpServletRequestHandler_127fc1c7163.java)
at 
$HttpServletRequestHandler_127fc1c715d.service($HttpServletRequestHandler_127fc1c715d.java)
at org.apache.tapestry5.TapestryFilter.doFilter(TapestryFilter.java:127)
at 
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
at 
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
at 
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at 
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at 
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:722)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:404)
at 
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
at org.mortbay.jetty.Server.handle(Server.java:324)
at 
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
at 
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:828)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
at 
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
at 
org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450)
Geoff



Re: PageRenderLinkSource not usable in HttpServletRequestHandler?

2010-04-14 Thread Robert Zeigler
That's possible... I doubt that Request/Request Globals have been  
initialized yet.
Is there some reason you specifically need an  
HttpServletRequestHandler as opposed to a RequestHandler? More of the  
T5 infrastructure is available/initialized within the RequestHandler  
pipeline...


Robert

On Apr 14, 2010, at 4/146:56 AM , Geoff Callender wrote:

It seems PageRenderLinkSource.createPageRenderLink(..) can't be used  
in an HttpServletRequestHandler because it results in  
NullPointerException. I'm using T5.1.0.5.


Can anyone confirm this? (and perhaps give a good alternative?)

java.lang.NullPointerException
at $Request_127fc1c71ae.getContextPath($Request_127fc1c71ae.java)
at $Request_127fc1c714e.getContextPath($Request_127fc1c714e.java)
	at  
org 
.apache 
.tapestry5 
.internal 
.services 
.ComponentEventLinkEncoderImpl 
.createPageRenderLink(ComponentEventLinkEncoderImpl.java:115)
	at  
$ 
ComponentEventLinkEncoder_127fc1c7176 
.createPageRenderLink($ComponentEventLinkEncoder_127fc1c7176.java)
	at  
org 
.apache 
.tapestry5 
.internal 
.services.LinkSourceImpl.createPageRenderLink(LinkSourceImpl.java:107)
	at  
$ 
LinkSource_127fc1c719d 
.createPageRenderLink($LinkSource_127fc1c719d.java)
	at  
org 
.apache 
.tapestry5 
.internal 
.services 
.PageRenderLinkSourceImpl 
.createPageRenderLink(PageRenderLinkSourceImpl.java:45)
	at  
org 
.apache 
.tapestry5 
.internal 
.services 
.PageRenderLinkSourceImpl 
.createPageRenderLink(PageRenderLinkSourceImpl.java:40)
	at  
$ 
PageRenderLinkSource_127fc1c715e 
.createPageRenderLink($PageRenderLinkSource_127fc1c715e.java)
	at  
jumpstart 
.web 
.services.AssetProtectionFilter.service(AssetProtectionFilter.java:49)
	at  
$ 
HttpServletRequestHandler_127fc1c7163 
.service($HttpServletRequestHandler_127fc1c7163.java)
	at  
$ 
HttpServletRequestHandler_127fc1c715d 
.service($HttpServletRequestHandler_127fc1c715d.java)
	at org.apache.tapestry5.TapestryFilter.doFilter(TapestryFilter.java: 
127)
	at org.mortbay.jetty.servlet.ServletHandler 
$CachedChain.doFilter(ServletHandler.java:1084)
	at  
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java: 
360)
	at  
org 
.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java: 
216)
	at  
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java: 
181)
	at  
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java: 
722)
	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java: 
404)
	at  
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java: 
139)

at org.mortbay.jetty.Server.handle(Server.java:324)
	at  
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java: 
505)
	at org.mortbay.jetty.HttpConnection 
$RequestHandler.headerComplete(HttpConnection.java:828)

at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
	at  
org 
.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java: 
395)
	at org.mortbay.thread.BoundedThreadPool 
$PoolThread.run(BoundedThreadPool.java:450)

Geoff




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



Re: PageRenderLinkSource not usable in HttpServletRequestHandler?

2010-04-14 Thread Howard Lewis Ship
Robert has it exactly; where possible, do the work inside
RequestHandler pipeline.  I've been gradually adding new methods to
Request to wrap HttpServletRequest methods ... in a worst case, inject
HttpServletRequest into your RequestFilter.

On Wed, Apr 14, 2010 at 5:05 AM, Robert Zeigler robe...@scazdl.org wrote:
 That's possible... I doubt that Request/Request Globals have been
 initialized yet.
 Is there some reason you specifically need an HttpServletRequestHandler as
 opposed to a RequestHandler? More of the T5 infrastructure is
 available/initialized within the RequestHandler pipeline...

 Robert

 On Apr 14, 2010, at 4/146:56 AM , Geoff Callender wrote:

 It seems PageRenderLinkSource.createPageRenderLink(..) can't be used in an
 HttpServletRequestHandler because it results in NullPointerException. I'm
 using T5.1.0.5.

 Can anyone confirm this? (and perhaps give a good alternative?)

 java.lang.NullPointerException
        at $Request_127fc1c71ae.getContextPath($Request_127fc1c71ae.java)
        at $Request_127fc1c714e.getContextPath($Request_127fc1c714e.java)
        at
 org.apache.tapestry5.internal.services.ComponentEventLinkEncoderImpl.createPageRenderLink(ComponentEventLinkEncoderImpl.java:115)
        at
 $ComponentEventLinkEncoder_127fc1c7176.createPageRenderLink($ComponentEventLinkEncoder_127fc1c7176.java)
        at
 org.apache.tapestry5.internal.services.LinkSourceImpl.createPageRenderLink(LinkSourceImpl.java:107)
        at
 $LinkSource_127fc1c719d.createPageRenderLink($LinkSource_127fc1c719d.java)
        at
 org.apache.tapestry5.internal.services.PageRenderLinkSourceImpl.createPageRenderLink(PageRenderLinkSourceImpl.java:45)
        at
 org.apache.tapestry5.internal.services.PageRenderLinkSourceImpl.createPageRenderLink(PageRenderLinkSourceImpl.java:40)
        at
 $PageRenderLinkSource_127fc1c715e.createPageRenderLink($PageRenderLinkSource_127fc1c715e.java)
        at
 jumpstart.web.services.AssetProtectionFilter.service(AssetProtectionFilter.java:49)
        at
 $HttpServletRequestHandler_127fc1c7163.service($HttpServletRequestHandler_127fc1c7163.java)
        at
 $HttpServletRequestHandler_127fc1c715d.service($HttpServletRequestHandler_127fc1c715d.java)
        at
 org.apache.tapestry5.TapestryFilter.doFilter(TapestryFilter.java:127)
        at
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
        at
 org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
        at
 org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
        at
 org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
        at
 org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:722)
        at
 org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:404)
        at
 org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
        at org.mortbay.jetty.Server.handle(Server.java:324)
        at
 org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
        at
 org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:828)
        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)
        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
        at
 org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
        at
 org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450)
 Geoff



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





-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

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



Re: PageRenderLinkSource not usable in HttpServletRequestHandler?

2010-04-14 Thread Geoff Callender
Thanks guys, making it a RequestHandler did the trick. On reflection, there was 
no need for it to be so early in the pipeline. I guess you could even argue it 
was inappropriate for it to be there, because an HttpServletRequestHandler 
isn't intended to be aware of Tapestry concepts like page and Link.

Geoff

On 15/04/2010, at 2:31 AM, Howard Lewis Ship wrote:

 Robert has it exactly; where possible, do the work inside
 RequestHandler pipeline.  I've been gradually adding new methods to
 Request to wrap HttpServletRequest methods ... in a worst case, inject
 HttpServletRequest into your RequestFilter.
 
 On Wed, Apr 14, 2010 at 5:05 AM, Robert Zeigler robe...@scazdl.org wrote:
 That's possible... I doubt that Request/Request Globals have been
 initialized yet.
 Is there some reason you specifically need an HttpServletRequestHandler as
 opposed to a RequestHandler? More of the T5 infrastructure is
 available/initialized within the RequestHandler pipeline...
 
 Robert
 
 On Apr 14, 2010, at 4/146:56 AM , Geoff Callender wrote:
 
 It seems PageRenderLinkSource.createPageRenderLink(..) can't be used in an
 HttpServletRequestHandler because it results in NullPointerException. I'm
 using T5.1.0.5.
 
 Can anyone confirm this? (and perhaps give a good alternative?)
 
 java.lang.NullPointerException
at $Request_127fc1c71ae.getContextPath($Request_127fc1c71ae.java)
at $Request_127fc1c714e.getContextPath($Request_127fc1c714e.java)
at
 org.apache.tapestry5.internal.services.ComponentEventLinkEncoderImpl.createPageRenderLink(ComponentEventLinkEncoderImpl.java:115)
at
 $ComponentEventLinkEncoder_127fc1c7176.createPageRenderLink($ComponentEventLinkEncoder_127fc1c7176.java)
at
 org.apache.tapestry5.internal.services.LinkSourceImpl.createPageRenderLink(LinkSourceImpl.java:107)
at
 $LinkSource_127fc1c719d.createPageRenderLink($LinkSource_127fc1c719d.java)
at
 org.apache.tapestry5.internal.services.PageRenderLinkSourceImpl.createPageRenderLink(PageRenderLinkSourceImpl.java:45)
at
 org.apache.tapestry5.internal.services.PageRenderLinkSourceImpl.createPageRenderLink(PageRenderLinkSourceImpl.java:40)
at
 $PageRenderLinkSource_127fc1c715e.createPageRenderLink($PageRenderLinkSource_127fc1c715e.java)
at
 jumpstart.web.services.AssetProtectionFilter.service(AssetProtectionFilter.java:49)
at
 $HttpServletRequestHandler_127fc1c7163.service($HttpServletRequestHandler_127fc1c7163.java)
at
 $HttpServletRequestHandler_127fc1c715d.service($HttpServletRequestHandler_127fc1c715d.java)
at
 org.apache.tapestry5.TapestryFilter.doFilter(TapestryFilter.java:127)
at
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
at
 org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
at
 org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at
 org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at
 org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:722)
at
 org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:404)
at
 org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
at org.mortbay.jetty.Server.handle(Server.java:324)
at
 org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
at
 org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:828)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
at
 org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
at
 org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450)
 Geoff
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org
 
 
 
 
 
 -- 
 Howard M. Lewis Ship
 
 Creator of Apache Tapestry
 
 The source for Tapestry training, mentoring and support. Contact me to
 learn how I can get you up and productive in Tapestry fast!
 
 (971) 678-5210
 http://howardlewisship.com
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org
 


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