org.dspace.app.webui.util
Class JSPManager

java.lang.Object
  extended by org.dspace.app.webui.util.JSPManager

public class JSPManager
extends Object

Methods for displaying UI pages to the user.

Version:
$Revision$
Author:
Robert Tansley

Constructor Summary
JSPManager()
           
 
Method Summary
static void showAuthorizeError(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, AuthorizeException exception)
          Display an authorization failed error message.
static void showFileSizeLimitExceededError(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String message, long actualSize, long permittedSize)
          Display a "file upload was too large" error message.
static void showIntegrityError(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Display an integrity error message.
static void showInternalError(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Display an internal server error message - for example, a database error
static void showInvalidIDError(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String badID, int type)
          Display an "invalid ID" error message.
static void showJSP(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String jsp)
          Forwards control of the request to the display JSP passed in.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JSPManager

public JSPManager()
Method Detail

showJSP

public static void showJSP(javax.servlet.http.HttpServletRequest request,
                           javax.servlet.http.HttpServletResponse response,
                           String jsp)
                    throws javax.servlet.ServletException,
                           IOException
Forwards control of the request to the display JSP passed in.

Parameters:
request - current servlet request object
response - current servlet response object
jsp - the JSP page to display, relative to the webapps directory
Throws:
javax.servlet.ServletException
IOException

showInternalError

public static void showInternalError(javax.servlet.http.HttpServletRequest request,
                                     javax.servlet.http.HttpServletResponse response)
                              throws javax.servlet.ServletException,
                                     IOException
Display an internal server error message - for example, a database error

Parameters:
request - the HTTP request
response - the HTTP response
Throws:
javax.servlet.ServletException
IOException

showIntegrityError

public static void showIntegrityError(javax.servlet.http.HttpServletRequest request,
                                      javax.servlet.http.HttpServletResponse response)
                               throws javax.servlet.ServletException,
                                      IOException
Display an integrity error message. Use when the POSTed data from a request doesn't make sense.

Parameters:
request - the HTTP request
response - the HTTP response
Throws:
javax.servlet.ServletException
IOException

showAuthorizeError

public static void showAuthorizeError(javax.servlet.http.HttpServletRequest request,
                                      javax.servlet.http.HttpServletResponse response,
                                      AuthorizeException exception)
                               throws javax.servlet.ServletException,
                                      IOException
Display an authorization failed error message. The exception should be passed in if possible so that the error message can be descriptive.

Parameters:
request - the HTTP request
response - the HTTP response
exception - the AuthorizeException leading to this error, passing in null will display default error message
Throws:
javax.servlet.ServletException
IOException

showInvalidIDError

public static void showInvalidIDError(javax.servlet.http.HttpServletRequest request,
                                      javax.servlet.http.HttpServletResponse response,
                                      String badID,
                                      int type)
                               throws javax.servlet.ServletException,
                                      IOException
Display an "invalid ID" error message. Passing in information about the bad ID and what the ID was supposed to represent (collection etc.) should result in a more descriptive and helpful error message.

Parameters:
request - the HTTP request
response - the HTTP response
badID - the bad identifier, or null
type - the type of object, from org.dspace.core.Constants, or -1 for a default message
Throws:
javax.servlet.ServletException
IOException

showFileSizeLimitExceededError

public static void showFileSizeLimitExceededError(javax.servlet.http.HttpServletRequest request,
                                                  javax.servlet.http.HttpServletResponse response,
                                                  String message,
                                                  long actualSize,
                                                  long permittedSize)
                                           throws javax.servlet.ServletException,
                                                  IOException
Display a "file upload was too large" error message. Passing in information about the size of the file uploaded, and the maximum file size limit so the user knows why they encountered an error.

Parameters:
request -
response -
message -
actualSize -
permittedSize -
Throws:
javax.servlet.ServletException
IOException


Copyright © 2013 DuraSpace. All Rights Reserved.