Added experimental res.forward() to forward a request to a local (static) resource.
The base resource must be mounted as <app>.protectedStatic in the apps.properties file.
This commit is contained in:
parent
0c6d25e038
commit
ea32bc9da4
2 changed files with 35 additions and 0 deletions
|
@ -73,6 +73,17 @@ public class ResponseBean implements Serializable {
|
||||||
res.redirect(url);
|
res.redirect(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @param url ...
|
||||||
|
*
|
||||||
|
* @throws RedirectException ...
|
||||||
|
*/
|
||||||
|
public void forward(String url) throws RedirectException {
|
||||||
|
res.forward(url);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -66,6 +66,9 @@ public final class ResponseTrans implements Externalizable {
|
||||||
// contains the redirect URL
|
// contains the redirect URL
|
||||||
private String redir = null;
|
private String redir = null;
|
||||||
|
|
||||||
|
// the forward (internal redirect) URL
|
||||||
|
private String forward = null;
|
||||||
|
|
||||||
// the last-modified date, if it should be set in the response
|
// the last-modified date, if it should be set in the response
|
||||||
private long lastModified = -1;
|
private long lastModified = -1;
|
||||||
|
|
||||||
|
@ -382,6 +385,27 @@ public final class ResponseTrans implements Externalizable {
|
||||||
return redir;
|
return redir;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @param url ...
|
||||||
|
*
|
||||||
|
* @throws RedirectException ...
|
||||||
|
*/
|
||||||
|
public void forward(String url) throws RedirectException {
|
||||||
|
forward = url;
|
||||||
|
throw new RedirectException(url);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @return ...
|
||||||
|
*/
|
||||||
|
public String getForward() {
|
||||||
|
return forward;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allow to directly set the byte array for the response. Calling this more than once will
|
* Allow to directly set the byte array for the response. Calling this more than once will
|
||||||
* overwrite the previous output. We take a generic object as parameter to be able to
|
* overwrite the previous output. We take a generic object as parameter to be able to
|
||||||
|
|
Loading…
Add table
Reference in a new issue