logo       

Re: POST request loosing data with incomplete URL: msg#00124

java.enhydra.general

Subject: Re: POST request loosing data with incomplete URL

On Út, 2002-10-29 at 16:36, Petr Stehlik wrote:

> The problem probably lies in the
> StandardApplication.requestPreprocessor() that does the remaping from
> incomplete "path/" to "path/DefaultUrl.po" by calling
> ClientPageRedirectException(completeUrl).

I developed the following patch and I think it should be included in the
Enhydra 5.x. It solves the problem with losing POST data and works
equally well for GET requests:

---
Enhydra/modules/EnhydraAppManager/src/com/lutris/appserver/server/StandardApplication.java
2002-08-27 12:04:14.000000000 +0200
+++
Enhydra/modules/EnhydraAppManager/src/com/lutris/appserver/server/StandardApplication.java.new
2002-10-30 13:35:50.000000000 +0100
@@ -598,24 +598,18 @@
if (!page.endsWith("/"))
page += "/";
if (page.equals(ap)) {
- // Don't want two slashes in a row.
- String target =
comms.request.getHttpServletRequest().getContextPath();
- if (target.equals("/")) {
- target = "";
- }
- target = "";
-
+ String target="";
if (defaultUrl.startsWith("/")) {
- target += ap + defaultUrl.substring(1);
+ target = defaultUrl.substring(1);
} else {
- target += ap + defaultUrl;
+ target = defaultUrl;
}
// get query string and add it to target
String query = comms.request.getQueryString();
if (query != null) {
target += "?" + query;
}
- throw new ClientPageRedirectException(target);
+ throw new ServerPageRedirectException(target);
}
}

Petr


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise