google / google/guice

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

Open
#647 1 comment 0 reactions 0 assignees View on GitHub
imported
Dominant language
Java
Stars
12.7k
Forks
1.7k
Avg merge
11m
Merged PRs (30d)
2

Description

_From [cefn@cefn.com](https://code.google.com/u/115551960274376151777/) 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_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.