You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently Guice mangles include() and forward() request attributes
Two suggested solutions.
Hand off to the servlet engine itself to do the forwarding properly, as suggested with example code and a patch for v2.0 by tmikov in bug 522 . Sadly this fix somehow didn't make it into 3.0, and of course the patch doesn't work against 3.0.
For example, a ForwardResolution is a standard technique for handling a form submission and then serving a result jsp in Stripes, which cannot be made to work at all in Guice, because the path information is messed up so bad that the corresponding resources can't be found after the forward. http://stripes.sourceforge.net/docs/current/javadoc/net/sourceforge/stripes/action/ForwardResolution.html Without this change, I and many others will be forced to resort to web.xml after much shouting and debugging to workaround this issue in Guice-servlet. This means sadly that it's easier to do without it rather than have two different places to specify servlet routing, one of which works sometimes.
I believe it's fairly major when mainstream Java servlet libraries like Stripes are broken and unfixable within a servlet engine because of something which is surely only a few minutes work; adding 5 request attributes inside the logic of both Guice forward(...) and guice include(...) respectively to conform to servlet standards.
The bug has been open for a very long time too.
I gave up trying to make sense of the Guice stubs and test framework after a fair amount of struggling to recreate this as a test case. What I need to do is NOT write stubs, and have the Guice framework actually execute the invalid forward or include (hence demonstrating its failure to update the mandatory request attributes). I cannot figure out how to execute this within the Guice svn source, sorry, though I tried.
From cefn@cefn.com on August 13, 2011 17:25:53
Currently Guice mangles include() and forward() request attributes
Two suggested solutions.
Hand off to the servlet engine itself to do the forwarding properly, as suggested with example code and a patch for v2.0 by tmikov in bug 522 . Sadly this fix somehow didn't make it into 3.0, and of course the patch doesn't work against 3.0.
Fix Guice so that it's forwarding logic conforms to the servlet specification helpfully described in summary at... http://www.caucho.com/resin-3.0/webapp/faq.xtp#include ...and here... http://www.caucho.com/resin-3.0/webapp/faq.xtp#forward ...and detailed in pages 91 and 92 Sections 9.3.1 and 9.4.2 of the formal servlet standard JSR315 available at http://www.jcp.org/en/jsr/detail?id=315 Libraries which depend on forwarding or inclusion and expect Guice to specify the path info correctly in return values and request attributes are currently totally broken in Guice.
For example, a ForwardResolution is a standard technique for handling a form submission and then serving a result jsp in Stripes, which cannot be made to work at all in Guice, because the path information is messed up so bad that the corresponding resources can't be found after the forward. http://stripes.sourceforge.net/docs/current/javadoc/net/sourceforge/stripes/action/ForwardResolution.html Without this change, I and many others will be forced to resort to web.xml after much shouting and debugging to workaround this issue in Guice-servlet. This means sadly that it's easier to do without it rather than have two different places to specify servlet routing, one of which works sometimes.
Original issue: http://code.google.com/p/google-guice/issues/detail?id=647
The text was updated successfully, but these errors were encountered: