com.jivesoftware.forum.util
Class DataExportServlet
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
com.jivesoftware.forum.util.DataExportServlet
- All Implemented Interfaces:
- java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
public class DataExportServlet
- extends javax.servlet.http.HttpServlet
A servlet to handle data export output to the browser. This servlet grabs a
PollableRunnable
instance from the request, session or context and
writes its output to the response output stream.
Init Parameters:
- key - the default key name of the runnable attribute. This can be overridden via a parameter.
This is set to 'jive.admin.dataexport.exporter' by default.
Parameters:
- key - the name of the runnable attribute.
- source - the object to retrieve the runnable from. This must be either 'request' (for a request
attribute), 'session' (for a session attribute) or 'context' (for an application-wide attribute).
'session' is the default if no parameter is passed in.
Things like the file name and export format (xml or zip) will be retrieved from the
DbDataExport
instance.
- Since:
- 4.0
- See Also:
- Serialized Form
Method Summary |
void |
init(javax.servlet.ServletConfig config)
Gets reference to the servlet context and loads the default attribute name (see class description). |
void |
service(javax.servlet.ServletRequest req,
javax.servlet.ServletResponse res)
Handles all requests to the servlet. |
Methods inherited from class javax.servlet.http.HttpServlet |
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service |
Methods inherited from class javax.servlet.GenericServlet |
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DataExportServlet
public DataExportServlet()
init
public void init(javax.servlet.ServletConfig config)
throws javax.servlet.ServletException
- Gets reference to the servlet context and loads the default attribute name (see class description).
- Specified by:
init
in interface javax.servlet.Servlet
- Overrides:
init
in class javax.servlet.GenericServlet
- Parameters:
config
- the ServletConfig object.
- Throws:
javax.servlet.ServletException
- if an error occurs while initializing the servlet.
service
public void service(javax.servlet.ServletRequest req,
javax.servlet.ServletResponse res)
throws java.io.IOException,
javax.servlet.ServletException
- Handles all requests to the servlet. Will look for a 'key' and a 'source' parameter - read the class
descriptiion for more information. Will retrieve a DbDataExport instance and stream its output to the
browser as an XML file or a ZIP file.
- Specified by:
service
in interface javax.servlet.Servlet
- Overrides:
service
in class javax.servlet.http.HttpServlet
- Parameters:
req
- the servlet request.res
- the servlet response.
- Throws:
java.io.IOException
- if an error occurs when writing the output the the browser.
javax.servlet.ServletException
- if any other error occurs.
Copyright © 1999-2006 Jive Software.