Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guice's include() and forward() should conform to servlet standards #647

Open
gissuebot opened this issue Jul 7, 2014 · 1 comment
Open
Labels

Comments

@gissuebot
Copy link

From cefn@cefn.com on August 13, 2011 17:25:53

Currently Guice mangles include() and forward() request attributes

Two suggested solutions.

  1. 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.

  2. 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

@gissuebot
Copy link
Author

From cefn@cefn.com on November 12, 2011 10:42:16

Is there any interest in fixing this bug?

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant