google / google/guice

Request parameter get lost when forwarding from one servlet to another

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

Description

Hi,

I think I've found a bug in the servlet extension of guice.
In a servlet, I'm forwarding the request to another servlet.

I've mapped to servlets:

```
serve("/", "/index.jsp").with(MainEntryServlet.class);
serve("/foobar.jsp").with(FooBarServlet.class);
```

I'm using the following code in my FooBar-Servlet:

```
String url = "/index.jsp?target=foo.jsp";
request.getRequestDispatcher(url).forward(request, response);
```

The MainEntryServlet gets called, but the paramter "target" is missing.
When I use the web.xml for servlet mapping, everything works fine.

Any idea, why the paramater gets lost, when mapping the servlets in the servlet module?

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.