Class VitroHttpServlet
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- javax.servlet.http.HttpServlet
-
- edu.cornell.mannlib.vitro.webapp.controller.VitroHttpServlet
-
- All Implemented Interfaces:
MultipartRequestWrapper.ParsingStrategy,Serializable,javax.servlet.Servlet,javax.servlet.ServletConfig
- Direct Known Subclasses:
Authenticate,BaseEditController,DashboardPropertyListController,DeletePageController,EditFrontController,EditRequestAJAXController,FileServingServlet,FreemarkerHttpServlet,GrefineMqlreadServlet,GrefinePropertyListServlet,JSONReconcileServlet,JsonServlet,MailUsersServlet,MenuManagementEdit,N3MultiPartUploadDELETEME,OntologyController,UserMailController,VitroLinkedDataFragmentServlet,WaitForBackgroundThreadsController
public class VitroHttpServlet extends javax.servlet.http.HttpServlet implements MultipartRequestWrapper.ParsingStrategy
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classVitroHttpServlet.PickListSorter
-
Field Summary
Fields Modifier and Type Field Description static StringHTML_MIMETYPEstatic StringJSON_LD_MIMETYPEstatic StringJSON_MIMETYPEstatic StringN3_MIMETYPEprotected static DateFormatpublicDateFormatstatic StringRDFXML_MIMETYPEstatic StringTTL_MIMETYPEstatic StringXHTML_MIMETYPE
-
Constructor Summary
Constructors Constructor Description VitroHttpServlet()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)doGet does nothing.protected voiddoPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)doPost does the same thing as the doGet methodprotected voiddumpRequestParameters(javax.servlet.http.HttpServletRequest req)A child class may call this if logging is set to debug level.protected booleanisAuthorizedToDisplayPage(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, AuthorizationRequest actions)Don't display a page that the user isn't authorized to see.longmaximumMultipartFileSize()Override this to change the maximum size of uploaded files in multipart requests.static voidredirectToInsufficientAuthorizationPage(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)Logged in, but with insufficient authorization.static voidredirectToLoginPage(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)Not logged in.static voidredirectUnauthorizedRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)voidservice(javax.servlet.ServletRequest req, javax.servlet.ServletResponse resp)protected voidsortForPickList(List<? extends ResourceBean> beans, VitroRequest vreq)booleanstashFileSizeException()Override this to change the way that exceptions are handled when parsing a multipart request.-
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service
-
-
-
-
Field Detail
-
publicDateFormat
protected static DateFormat publicDateFormat
-
XHTML_MIMETYPE
public static final String XHTML_MIMETYPE
- See Also:
- Constant Field Values
-
HTML_MIMETYPE
public static final String HTML_MIMETYPE
- See Also:
- Constant Field Values
-
RDFXML_MIMETYPE
public static final String RDFXML_MIMETYPE
- See Also:
- Constant Field Values
-
JSON_MIMETYPE
public static final String JSON_MIMETYPE
- See Also:
- Constant Field Values
-
JSON_LD_MIMETYPE
public static final String JSON_LD_MIMETYPE
- See Also:
- Constant Field Values
-
N3_MIMETYPE
public static final String N3_MIMETYPE
- See Also:
- Constant Field Values
-
TTL_MIMETYPE
public static final String TTL_MIMETYPE
- See Also:
- Constant Field Values
-
-
Method Detail
-
service
public final void service(javax.servlet.ServletRequest req, javax.servlet.ServletResponse resp) throws javax.servlet.ServletException, IOException- Specified by:
servicein interfacejavax.servlet.Servlet- Overrides:
servicein classjavax.servlet.http.HttpServlet- Throws:
javax.servlet.ServletExceptionIOException
-
maximumMultipartFileSize
public long maximumMultipartFileSize()
Override this to change the maximum size of uploaded files in multipart requests.- Specified by:
maximumMultipartFileSizein interfaceMultipartRequestWrapper.ParsingStrategy
-
stashFileSizeException
public boolean stashFileSizeException()
Override this to change the way that exceptions are handled when parsing a multipart request. Be aware that multipart parameters have been lost, and that may include form fields.- Specified by:
stashFileSizeExceptionin interfaceMultipartRequestWrapper.ParsingStrategy
-
doGet
protected void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOExceptiondoGet does nothing.- Overrides:
doGetin classjavax.servlet.http.HttpServlet- Throws:
javax.servlet.ServletExceptionIOException
-
doPost
protected void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOExceptiondoPost does the same thing as the doGet method- Overrides:
doPostin classjavax.servlet.http.HttpServlet- Throws:
javax.servlet.ServletExceptionIOException
-
isAuthorizedToDisplayPage
protected boolean isAuthorizedToDisplayPage(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, AuthorizationRequest actions)Don't display a page that the user isn't authorized to see.- Parameters:
actions- the combination of RequestedActions that must be authorized.
-
redirectUnauthorizedRequest
public static void redirectUnauthorizedRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
-
redirectToInsufficientAuthorizationPage
public static void redirectToInsufficientAuthorizationPage(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)Logged in, but with insufficient authorization. Send them to the home page with a message. They won't be coming back.
-
redirectToLoginPage
public static void redirectToLoginPage(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)Not logged in. Send them to the login page, and then back to the page that invoked this.
-
sortForPickList
protected void sortForPickList(List<? extends ResourceBean> beans, VitroRequest vreq)
-
dumpRequestParameters
protected void dumpRequestParameters(javax.servlet.http.HttpServletRequest req)
A child class may call this if logging is set to debug level.
-
-