org.dspace.app.webui.servlet
Class DSpaceServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.dspace.app.webui.servlet.DSpaceServlet
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
Direct Known Subclasses:
AbstractBrowserServlet, AdvancedSearchServlet, AuthorityChooseServlet, AuthorizeAdminServlet, BitstreamFormatRegistry, BitstreamServlet, CollectionWizardServlet, CommunityListServlet, ControlledVocabularySearchServlet, ControlledVocabularyServlet, DisplayStatisticsServlet, EditCommunitiesServlet, EditItemServlet, EditProfileServlet, EPersonAdminServlet, EPersonListServlet, FeedbackServlet, FeedServlet, GroupEditServlet, GroupListServlet, HandleServlet, HTMLServlet, ItemExportArchiveServlet, ItemMapServlet, LDAPServlet, LicenseEditServlet, LogoutServlet, MetadataExportServlet, MetadataFieldRegistryServlet, MetadataImportServlet, MetadataSchemaRegistryServlet, MyDSpaceServlet, NewsEditServlet, OpenSearchServlet, OpenURLServlet, PasswordServlet, RegisterServlet, RetrieveServlet, ShibbolethServlet, SimpleSearchServlet, SitemapServlet, StatisticsServlet, SubmissionController, SubscribeServlet, SuggestServlet, SuperviseServlet, ViewWorkspaceItemServlet, WorkflowAbortServlet, WorkspaceServlet, X509CertificateServlet

public class DSpaceServlet
extends javax.servlet.http.HttpServlet

Base class for DSpace servlets. This manages the initialisation of a context, if a context has not already been initialised by an authentication filter. It also grabs the original request URL for later use.

Unlike regular servlets, DSpace servlets should override the doDSGet and doDSPost methods, which provide a DSpace context to work with, and handle the common exceptions SQLException and AuthorizeException. doGet and doPost should be overridden only in special circumstances.

Note that if all goes well, the context object passed in to doDSGet and doDSPut must be completed after a JSP has been displayed, but before the method returns. If an error occurs (an exception is thrown, or the context is not completed) the context is aborted after doDSGet or doDSPut return.

Version:
$Revision$
Author:
Robert Tansley
See Also:
Context, Serialized Form

Constructor Summary
DSpaceServlet()
           
 
Method Summary
protected  void doDSGet(Context context, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Process an incoming HTTP GET.
protected  void doDSPost(Context context, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Process an incoming HTTP POST.
protected  void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
protected  void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DSpaceServlet

public DSpaceServlet()
Method Detail

doGet

protected void doGet(javax.servlet.http.HttpServletRequest request,
                     javax.servlet.http.HttpServletResponse response)
              throws javax.servlet.ServletException,
                     IOException
Overrides:
doGet in class javax.servlet.http.HttpServlet
Throws:
javax.servlet.ServletException
IOException

doPost

protected void doPost(javax.servlet.http.HttpServletRequest request,
                      javax.servlet.http.HttpServletResponse response)
               throws javax.servlet.ServletException,
                      IOException
Overrides:
doPost in class javax.servlet.http.HttpServlet
Throws:
javax.servlet.ServletException
IOException

doDSGet

protected void doDSGet(Context context,
                       javax.servlet.http.HttpServletRequest request,
                       javax.servlet.http.HttpServletResponse response)
                throws javax.servlet.ServletException,
                       IOException,
                       SQLException,
                       AuthorizeException
Process an incoming HTTP GET. If an exception is thrown, or for some other reason the passed in context is not completed, it will be aborted and any changes made by this method discarded when this method returns.

Parameters:
context - a DSpace Context object
request - the HTTP request
response - the HTTP response
Throws:
SQLException - if a database error occurs
AuthorizeException - if some authorization error occurs
javax.servlet.ServletException
IOException

doDSPost

protected void doDSPost(Context context,
                        javax.servlet.http.HttpServletRequest request,
                        javax.servlet.http.HttpServletResponse response)
                 throws javax.servlet.ServletException,
                        IOException,
                        SQLException,
                        AuthorizeException
Process an incoming HTTP POST. If an exception is thrown, or for some other reason the passed in context is not completed, it will be aborted and any changes made by this method discarded when this method returns.

Parameters:
context - a DSpace Context object
request - the HTTP request
response - the HTTP response
Throws:
SQLException - if a database error occurs
AuthorizeException - if some authorization error occurs
javax.servlet.ServletException
IOException


Copyright © 2013 DuraSpace. All Rights Reserved.