public class JSpellServlet
extends javax.servlet.http.HttpServlet
Modifier and Type | Field and Description |
---|---|
protected java.text.SimpleDateFormat |
logDateFmt
Date format for log files.
|
protected static JSpellDictionaryManager |
manager |
protected java.lang.String |
softwareID |
protected long |
startTime |
protected Suggestions |
suggestions |
Constructor and Description |
---|
JSpellServlet()
Constructs the JSpellServlet instance.
|
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Closes any open logging and JSpellIndex resources.
|
void |
doGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Handles incoming GET requests from clients and delegates to processClientData.
|
protected void |
doPost(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Handles incoming POST requests from clients and delegates to processClientData.
|
java.lang.String |
getCacheSize()
Returns the current value of the cacheSize initialized by the Servlet init and context params.
|
java.lang.String |
getIndexDirectory()
Returns the location of the JSpell dictionary files.
|
java.lang.String |
getLogFileName()
Returns the current value of the logFileName.
|
java.lang.String |
getPropertiesFile()
Returns the current value of the propertiesFile.
|
java.lang.String |
getServletInfo()
Returns the name, copyright and authorship of the JSpellServlet.
|
protected void |
indexChanged()
Called whenever the language or country changes.
|
void |
init(javax.servlet.ServletConfig config)
Called whenever the JSpellServlet is loaded by the Java servlet container.
|
void |
logAccess(java.lang.String msg)
Provides logging ability for the JSpellServlet instances.
|
protected void |
logFileNameChanged()
Called whenever the logFileName changes.
|
void |
markUsageBegin() |
void |
markUsageEnd() |
protected java.lang.StringBuffer |
processClientData(java.util.Vector text,
JSpellDictionaryLocal jdLocal)
Handles incoming client requests to search for a word and return suggestions or add a new word to the dictionary.
|
protected void |
propertiesFileChanged()
Called whenever the propertiesFile property is changed and upon initialization of the servlet.
|
void |
setCacheSize(java.lang.String cacheSize)
Changes the cacheSize value.
|
void |
setIndexDirectory(java.lang.String indexDirectory)
Sets the location of the JSpell dictionary files.
|
void |
setLogFileName(java.lang.String logFileName)
Changes the logFileName value.
|
void |
setPropertiesFile(java.lang.String propertiesFile)
Change the propertiesFile value.
|
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
protected Suggestions suggestions
protected static JSpellDictionaryManager manager
protected java.text.SimpleDateFormat logDateFmt
protected java.lang.String softwareID
protected long startTime
protected void propertiesFileChanged() throws javax.servlet.ServletException
javax.servlet.ServletException
- a ServletException object.protected void indexChanged() throws javax.servlet.ServletException
javax.servlet.ServletException
- a ServletException object.protected void logFileNameChanged() throws javax.servlet.ServletException
javax.servlet.ServletException
- a ServletException object.public void setPropertiesFile(java.lang.String propertiesFile) throws javax.servlet.ServletException
propertiesFile
- a String.javax.servlet.ServletException
- a ServletException object.public java.lang.String getPropertiesFile()
public void setIndexDirectory(java.lang.String indexDirectory) throws javax.servlet.ServletException
indexDirectory
- a String.javax.servlet.ServletException
- a ServletException object.public java.lang.String getIndexDirectory()
public void setLogFileName(java.lang.String logFileName) throws javax.servlet.ServletException
logFileName
- a String.javax.servlet.ServletException
- a ServletException object.public java.lang.String getLogFileName()
public void setCacheSize(java.lang.String cacheSize) throws javax.servlet.ServletException
cacheSize
- a String containing an int value representing the cache size.javax.servlet.ServletException
- a ServletException object.public java.lang.String getCacheSize()
public void init(javax.servlet.ServletConfig config) throws javax.servlet.ServletException
init
in interface javax.servlet.Servlet
init
in class javax.servlet.GenericServlet
config
- a ServletConfig object.javax.servlet.ServletException
- a ServletException object.protected final java.lang.StringBuffer processClientData(java.util.Vector text, JSpellDictionaryLocal jdLocal)
text
- a Vector.jdLocal
- a JSpellDictionaryLocal object.public final void logAccess(java.lang.String msg)
msg
- a String.public void destroy()
destroy
in interface javax.servlet.Servlet
destroy
in class javax.servlet.GenericServlet
public java.lang.String getServletInfo()
getServletInfo
in interface javax.servlet.Servlet
getServletInfo
in class javax.servlet.GenericServlet
public void markUsageBegin()
public void markUsageEnd()
protected void doPost(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, java.io.IOException
doPost
in class javax.servlet.http.HttpServlet
req
- an HttpServletRequest object.resp
- an HttpServletResponse object.javax.servlet.ServletException
- a ServletException object.java.io.IOException
- an IOException object.public void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, java.io.IOException
doGet
in class javax.servlet.http.HttpServlet
req
- an HttpServletRequest object.resp
- an HttpServletResponse object.javax.servlet.ServletException
- a ServletException object.java.io.IOException
- an IOException object.JSpell SDK - Spell Checker for the Java Platform
Copyright © 2009-2019 Page Scholar Inc, All Rights Reserved - https://www.jspell.com