Em Thu, 08 Oct 2009 20:55:04 -0300, cuartz <carlos.pc...@gmail.com> escreveu:

Hello everybody,

Hi!

i had a problem trying to use the tapestr5 IoC from tapestry 4 pages, its a big system whit tpaestry5 and tapestry 4 pages, when i call a service that handles the request (org.apache.tapestry5.services.Request) from tapestry5 pages everything is ok, but when i call this service from a tapestry4 page i get a java.lang.RuntimeException, everithing is ok but when the service call some method from the request i get this error.

I guess this happens because Request is a shadow service: actually, when you use an injected instance of it, you're calling RequestGlobals.getRequest(). This method returns a Request instance set during Tapestry 5 request processing. Whan a request is handled by Tapestry 4, RequestGlobal, which is a perthread service, doesn't have the Request set, then you have your exception. One possible solution is to invoke RequestGlobals.storeRequestResponse(Request request, Response response) yourself before Request is used.

--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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

Reply via email to