public class IlvSDMServlet
extends javax.servlet.http.HttpServlet
HttpServlet
.
You can use this class directly to view an XML data file styled with a style sheet
using SDM facilities.
If you want to provide
additional behavior (in particular a different allocation of
views to sessions), you must subclass IlvSDMServletSupport
and override createServletSupport()
to create an instance of
your subclass.
This basic implementation works in two modes:
The servlet accepts the following configuration parameters:
"multiSession"
- With the value "true"
,
sets the servlet to multi-session mode.
"xmlFile"
- The XML data that is initially loaded
in the SDM engine.
"styleSheet"
- The CSS file that is initially used
by the SDM engine.
"dataURL"
- The URL of a directory where the data
files (style sheets, XML files, icons, and so on) are located
on the server.
xml
and css
in the request URL to load a new XML file or a new CSS file.Constructor and Description |
---|
IlvSDMServlet()
Creates an SDM servlet.
|
Modifier and Type | Method and Description |
---|---|
void |
addServerActionListener(ServerActionListener listener)
Adds the specified listener to receive events when an action
is requested from the client.
|
protected IlvSDMServletSupport |
createServletSupport()
Deprecated.
Beginning with Rogue Wave JViews 7.5 use
createServletSupport(ServletContext)
instead. |
protected IlvSDMServletSupport |
createServletSupport(javax.servlet.ServletContext context)
Creates the supporting object to which this servlet
delegates most of its methods.
|
void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Responds to the servlet request.
|
void |
doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Responds to the servlet request.
|
String |
getDataURL()
Returns the URL of the directory where the data files
(such as icon files, style sheets, and XML files) are
located.
|
String |
getDefaultStyleSheet()
Returns the default style sheet file.
|
String |
getDefaultXmlFile()
Returns the default XML data file.
|
float |
getJPEGQuality()
Returns the quality of the produced JPEG file.
|
IlvSDMServletSupport |
getServletSupport()
Returns the supporting object to which this servlet
delegates most of its methods.
|
void |
init(javax.servlet.ServletConfig config)
Initializes the servlet.
|
boolean |
isMultiSession()
Returns
true if the servlet is in multisession mode. |
boolean |
isVerbose()
Returns
true if the servlet is in verbose mode. |
protected void |
prepareSession(javax.servlet.http.HttpServletRequest request)
Prepares a session for the client.
|
void |
removeServerActionListener(ServerActionListener listener)
Removes the specified listener so that it no longer receives events
generated from the client.
|
void |
setDataURL(String url)
Sets the URL of the directory where the data files
(such as icon files, style sheets, and XML files) are
located.
|
void |
setDefaultStyleSheet(String styleSheet)
Sets the default style sheet file.
|
void |
setDefaultXmlFile(String xmlFile)
Sets the default XML data file.
|
void |
setJPEGQuality(float quality)
Sets the quality of the produced JPEG file.
|
void |
setMultiSession(boolean multiSession)
Sets whether the servlet is in multisession mode.
|
void |
setStyleSheet(javax.servlet.http.HttpServletRequest request,
String styleSheet)
Sets the style sheet of the SDM engine.
|
void |
setVerbose(boolean value)
Turns the verbose mode on and off.
|
void |
setXmlFile(javax.servlet.http.HttpServletRequest request,
String xmlFile)
Loads an XML data file in the SDM engine.
|
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
public void init(javax.servlet.ServletConfig config) throws javax.servlet.ServletException
"multiSession"
,
"styleSheet"
, "xmlFile"
, and
"dataURL"
parameters.init
in interface javax.servlet.Servlet
init
in class javax.servlet.GenericServlet
config
- The object holding the configuration information for the servlet.javax.servlet.ServletException
@Deprecated protected IlvSDMServletSupport createServletSupport()
createServletSupport(ServletContext)
instead.
This default implementation returns a new instance of
IlvSDMServletSupport
.
To add functionalities to the servlet, you can override
this method and return an instance of your own subclass
of IlvSDMServletSupport
.
protected IlvSDMServletSupport createServletSupport(javax.servlet.ServletContext context)
This default implementation returns a new instance of
IlvSDMServletSupport
.
To add functionalities to the servlet, you can override
this method and return an instance of your own subclass
of IlvSDMServletSupport
.
context
- The servlet context.public IlvSDMServletSupport getServletSupport()
public void setMultiSession(boolean multiSession)
multiSession
parameter is true
),
a new SDM view will be created for each different session
connected to this servlet. Otherwise, only one SDM view is
created, and it is shared by all sessions.multiSession
- true
for multisession mode, and
false
for monosession mode.public boolean isMultiSession()
true
if the servlet is in multisession mode.setMultiSession(boolean)
public void setDefaultStyleSheet(String styleSheet)
init(javax.servlet.ServletConfig)
method of the servlet to initialize
the default style sheet used to initialize the SDM engine
when a new client connects to the servlet.styleSheet
- The new default style sheet file.public String getDefaultStyleSheet()
public void setDefaultXmlFile(String xmlFile)
init(javax.servlet.ServletConfig)
method of the servlet to initialize
the default XML file used to initialize the SDM engine
when a new client connects to the servlet.xmlFile
- The new default XML data file.public String getDefaultXmlFile()
public void setDataURL(String url)
url
- The URL.public String getDataURL()
public void setStyleSheet(javax.servlet.http.HttpServletRequest request, String styleSheet)
request
- The request being processed.styleSheet
- The style sheet file or URL.public void setXmlFile(javax.servlet.http.HttpServletRequest request, String xmlFile)
request
- The request being processed.xmlFile
- The name or URL of the XML file containing the data.public final void addServerActionListener(ServerActionListener listener)
ilog.views.thinclient.IlvView.performAction
method
is called. This method queries the server for a new image, but
additional parameters are sent in the image request so that
an action such as adding, removing, or selecting objects can be
performed before the image is generated. An action is
defined by a name and a list of parameters. To implement
the action on the client side, you will implement
the ServerActionListener
interface
and check the action name and parameters in the event.listener
- The listener.removeServerActionListener(ilog.views.servlet.ServerActionListener)
public final void removeServerActionListener(ServerActionListener listener)
listener
- The listener.addServerActionListener(ilog.views.servlet.ServerActionListener)
public final void setVerbose(boolean value)
value
- true
to turn the verbose mode to on.isVerbose()
public final boolean isVerbose()
true
if the servlet is in verbose mode.setVerbose(boolean)
public final void setJPEGQuality(float quality)
quality
- Can be in the [0,1]
range: 0
for bad quality
and high compression, and 1
for high quality and poor compression.
The default value is 0.75
.getJPEGQuality()
public final float getJPEGQuality()
0.75
.setJPEGQuality(float)
protected void prepareSession(javax.servlet.http.HttpServletRequest request)
request
- The current request.public void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException, javax.servlet.ServletException
prepareSession(javax.servlet.http.HttpServletRequest)
method, and then
the IlvSDMServletSupport.handleRequest(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
method of the support object returned
by getServletSupport()
. You
do not usually need to override this method. To add a new type of request, you
must subclass IlvSDMServletSupport
and override the method
IlvSDMServletSupport.handleRequest(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
.doGet
in class javax.servlet.http.HttpServlet
request
- The current HTTP request.response
- The HTTP response.IOException
javax.servlet.ServletException
public void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException, javax.servlet.ServletException
doGet
.doPost
in class javax.servlet.http.HttpServlet
request
- The current HTTP request.response
- The HTTP response.IOException
javax.servlet.ServletException
doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.