Methods Summary |
---|
public void | addParameter(java.lang.String name, java.lang.String value)
params.addParameter(name, value);
|
public int | doEndTag()
String result; // the eventual result
// add (already encoded) parameters
String baseUrl = resolveUrl(value, context, pageContext);
result = params.aggregateParams(baseUrl);
// if the URL is relative, rewrite it
if (!ImportSupport.isAbsoluteUrl(result)) {
HttpServletResponse response =
((HttpServletResponse) pageContext.getResponse());
result = response.encodeURL(result);
}
// store or print the output
if (var != null)
pageContext.setAttribute(var, result, scope);
else {
try {
pageContext.getOut().print(result);
} catch (java.io.IOException ex) {
throw new JspTagException(ex.toString(), ex);
}
}
return EVAL_PAGE;
|
public int | doStartTag()
params = new ParamSupport.ParamManager();
return EVAL_BODY_BUFFERED;
|
private void | init()
value = var = null;
params = null;
context = null;
scope = PageContext.PAGE_SCOPE;
|
public void | release()
init();
|
public static java.lang.String | resolveUrl(java.lang.String url, java.lang.String context, javax.servlet.jsp.PageContext pageContext)
// don't touch absolute URLs
if (ImportSupport.isAbsoluteUrl(url))
return url;
// normalize relative URLs against a context root
HttpServletRequest request =
(HttpServletRequest) pageContext.getRequest();
if (context == null) {
if (url.startsWith("/"))
return (request.getContextPath() + url);
else
return url;
} else {
if (!context.startsWith("/") || !url.startsWith("/")) {
throw new JspTagException(
Resources.getMessage("IMPORT_BAD_RELATIVE"));
}
if (context.equals("/")) {
// Don't produce string starting with '//', many
// browsers interpret this as host name, not as
// path on same host.
return url;
} else {
return (context + url);
}
}
|
public void | setScope(java.lang.String scope)
this.scope = Util.getScope(scope);
|
public void | setVar(java.lang.String var)
this.var = var;
|