Methods Summary |
---|
public int | doEndTag()Looks for the specified session bean. If not found, forwards the
request to the specifed error page with the parameters origURL and
errorMsg.
if (pageContext.getAttribute(name, PageContext.SESSION_SCOPE) == null) {
HttpServletRequest request =
(HttpServletRequest) pageContext.getRequest();
String origURL = HttpUtils.getRequestURL(request).toString();
String queryString = request.getQueryString();
if (queryString != null) {
origURL += "?" + queryString;
}
String loginURL = loginPage + "?origURL=" +
URLEncoder.encode(origURL) +
"&errorMsg=" + URLEncoder.encode(errorMsg);
try {
pageContext.forward(loginURL);
}
catch (IOException e) {
throw new JspException("IOException when forwarding to loginPage: " +
e.getMessage());
}
catch (ServletException e) {
throw new JspException("ServletException when forwarding to loginPage: " +
e.getMessage());
}
return SKIP_PAGE;
}
return EVAL_PAGE;
|
public void | release()Releases all instance variables.
name = null;
errorMsg = null;
loginPage = null;
super.release();
|
public void | setErrorMsg(java.lang.String errorMsg)Sets the error message to display on the login page.
this.errorMsg = errorMsg;
|
public void | setLoginPage(java.lang.String loginPage)Sets the login page URL
this.loginPage = loginPage;
|
public void | setName(java.lang.String name)Sets the name of the session object to look for.
this.name = name;
|