logo       

DefaultUrl behaviour change - please advise: msg#00033

java.enhydra.general

Subject: DefaultUrl behaviour change - please advise

Hi,

each Enhydra application can have a DefaltUrl defined in its config
file. When a client's browser visits the root ("/") of the application
it's redirected automatically to the DefaultUrl.

The redirection is done using ClientPageRedirectException in Enhydra
5.0. I have found out that when you do a GET request to the root of the
application it's redirected including the parameters that are in the
query part of the original URL. But if you do a POST request to the root
of the application the parameters are lost - the
ClientPageRedirectException does not preserve them.

I tried to fix this by changing the Client..Exception to
Server..Exception. I developed and tested a patch, posted it here and
also sent it to the Together team that works on Enhydra 5.1 right now.

They quickly found out that my patch broke the example applications -
for example DiscRack. The reason is that DiscRack uses DefaultUrl that
includes a path ("/personMgmt/Login.po") and the
ServerPageRedirectException is unable to change the path. This causes
that the FORM on the Login page cannot be sent as the ACTION contains a
page name relative to the "/personMgmt/" path while the browser is still
in the root of the URL (ServerPageRedirectException didn't let the
browser know about new path).

Now my questions:

- is it possible to modify the ClientPageRedirectException so it would
preserve the POST parameters?

- is it possible to modify the ServerPageRedirectException so it would
let the browser know about the new URL path?

I assume both answers are No (please correct me if I am wrong) so I have
the final question: What would you think about including my modified
patch in Enhydra 5.1 that would use ServerPageRedirectException if the
DefaultUrl would not contain a path (so the POST params would be
preserved) but would switch to ClientPageRedirectException if the
DefaultUrl would contain a path (so that the subsequent browser requests
for relative URLs would work).

I realize that different behaviour of DefaultUrl depending on whether it
contains a path or not is not a good solution but at the same time
losing the POST parameters is neither a good thing.

What would you suggest?

Petr


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

News | FAQ | advertise