示例#1
0
 private String processAuthenticationRequiredException(HttpServletRequest request)
     throws JspException {
   String key =
       (String)
           request
               .getSession()
               .getAttribute(JAMWikiAuthenticationConstants.JAMWIKI_AUTHENTICATION_REQUIRED_KEY);
   String uri =
       (String)
           request
               .getSession()
               .getAttribute(
                   JAMWikiAuthenticationConstants.JAMWIKI_AUTHENTICATION_REQUIRED_URI_KEY);
   if (key == null) {
     return null;
   }
   Object[] params = {uri};
   String message = Utilities.formatMessage(key, ServletUtil.retrieveUserLocale(request), params);
   request
       .getSession()
       .removeAttribute(JAMWikiAuthenticationConstants.JAMWIKI_AUTHENTICATION_REQUIRED_KEY);
   request
       .getSession()
       .removeAttribute(JAMWikiAuthenticationConstants.JAMWIKI_AUTHENTICATION_REQUIRED_URI_KEY);
   return formatMessage(message);
 }
示例#2
0
 private String processAuthorizationException(HttpServletRequest request) throws JspException {
   String key = (String) request.getParameter("message");
   if (key == null) {
     return null;
   }
   String message = Utilities.formatMessage(key, ServletUtil.retrieveUserLocale(request));
   return formatMessage(message);
 }
示例#3
0
 private String processLegacyLogin(HttpServletRequest request) throws JspException {
   WikiMessage messageObject = (WikiMessage) request.getAttribute("messageObject");
   if (messageObject == null) {
     return null;
   }
   String message =
       Utilities.formatMessage(
           messageObject.getKey(),
           ServletUtil.retrieveUserLocale(request),
           messageObject.getParams());
   return formatMessage(message);
 }