These servlet configuration parameters are understood by this servlet.
portNumber- Port number to use. The default is 1527.
startNetworkServerOnInit- Starts the Derby Network Server at servlet initialization if 'true'.
tracingDirectory- Directory for trace files
| Modifier and Type | Field and Description |
|---|---|
| private String | |
| private static final int | |
| private static final String[] | |
| private volatile boolean | |
| private static final int | |
| private static final int | |
| private int | |
| private NetworkServerControl | |
| private static final String | |
| private static final String | |
| private volatile boolean | |
| private volatile String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private void | displayCurrentStatus(LocalizedResource
LocalizedResource to use for localizing messages localUtil, String localized continue message for continue button on error form returnMessage, PrintWriter Form PrintWriter out)Display the current Network server status |
| public synchronized void | doGet(HttpServletRequest
an request, HttpServletResponse HttpServletRequest object that
contains the request the client has made of the servletan response)HttpServletResponse object that
contains the response the servlet sends to the clientOverrides javax. |
| public void | doPost(HttpServletRequest
an request, HttpServletResponse HttpServletRequest object that
contains the request the client has made of the servletan response)HttpServletResponse object that
contains the response the servlet sends to the clientOverrides javax. |
| private String | Returns: A sanitized string.the string to escape str)Escapes potentially dangerous characters in data written to the browser. |
| private String | escapeSingleQuotes(String
The string in which we want to escape
single quotes. str)If the received string has one or more single quotes in it, replace each one with the HTML escape-code for a single quote (apostrophe) so that the string can be properly displayed on a submit button. |
| private String | Returns: fixed version of the language, with _ separating parts and country in upper caselanguage to be fixed lang)Fix the language code, as some browsers send then in a bad format (for instance, Firefox sends en-us instead of en_US). |
| private String | |
| private LocalizedResource | Returns: the appUI which fits the browsers preferencesHttpServetRequest for forms request, String[] Name of locale (return arg) locale)Determine the locale file needed for this browsers preferences Defaults to the settings for derby.locale and derby.codeset if set English otherwise if browsers preferences can't be found |
| private String | |
| private String | |
| private String | getHtmlLabelledMessageInstance(LocalizedResource localUtil, String key, String id)
get an HTML labelled message from the resource bundle file, according to the given key. |
| private int | getIntParameter(HttpServletRequest
HttpServetRequest for forms request, String parameter name name, String Key for the name of the field we're reading. fieldKey, LocalizedResource LocalizedResource to use in localizing messages localUtil, String localized continue message for continue button on error form returnMessage, PrintWriter Form PrintWriter out)Get an integer parameter |
| private String | Returns: stripped language string to use in matchinglanguage string to parse lang)Get locale string from language which may have qvalue set |
| private String | |
| private String | Returns: decoded StringHttpServletRequest request, String Parameter name paramName)get UTF8 parameter value and decode international characters |
| private boolean | Returns: true if server is up and reachable; false; otherwiseGet the currrent server status by using test connection |
| private String | |
| public void | init(ServletConfig
the config)ServletConfig object
that contains configutation information for this servletOverrides javax. Implements javax. |
| private static boolean | |
| private boolean | Returns: true if succeeded; false; otherwiseLocalizedResource to use to translate messages localUtil, boolean val, String localized continue message for continue button on error form returnMessage, PrintWriter Form PrintWriter out)Turn logging of connections on |
| private void | printAsContentHeader(String
The string to be printed as a header. str, PrintWriter Form PrintWriter out)Print the received string as a header. |
| private void | |
| private void | printErrorForm(LocalizedResource
LocalizedResource to use to translate messages localUtil, Exception Exception to be displayed e, String localized continue message for continue button on error form returnMessage, PrintWriter Form PrintWriter out)Display an error form |
| private void | printErrorForm(LocalizedResource
LocalizedResource to use to translate messages localUtil, String String to be displayed msg, String localized continue message for continue button on error form returnMessage, PrintWriter Form PrintWriter out)Display an error form |
| private void | runServer(LocalizedResource
LocalizedResource to use to translate messages localUtil, String localized continue message for continue button on error form returnMessage, PrintWriter Form PrintWriter out)Start the network server and attempt to connect to it before returning |
| private void | |
| private boolean | Returns: true if succeeded; false; otherwiseLocalizedResource to use to translate messages localUtil, int maximum number of threads max, int time slice for each connection slice, String localized continue message for continue button on error form returnMessage, PrintWriter Form PrintWriter out)Set Network server parameters |
| private boolean | Returns: true if succeeded; false; otherwiseLocalizedResource to use to translate messages localUtil, String localized continue message for continue button on error form returnMessage, PrintWriter Form PrintWriter out)Shutdown the network server |
| private boolean | Returns: true if succeeded; false; otherwiseLocalizedResource to use to translate messages localUtil, boolean if true, turn tracing on, if false turn it off val, String localized continue message for continue button on error form returnMessage, PrintWriter Form PrintWriter out)Change tracing for all sessions |
| private boolean | Returns: true if succeeded; false; otherwiseLocalizedResource to use to translate messages localUtil, String directory for trace files traceDirectory, String localized continue message for continue button on error form returnMessage, PrintWriter Form PrintWriter out)Set trace directory |
| private boolean | Returns: true if succeeded; false; otherwiseLocalizedResource to use to translate messages localUtil, boolean if true, turn tracing on, if false turn it off val, int session to trace session, String localized continue message for continue button on error form returnMessage, PrintWriter Form PrintWriter out)Change tracing for a given session |
| private int | Returns: index into language array if found, -1 otherwise;language we are looking for lang)Check if the required translation is available |
| host | back to summary |
|---|---|
| private String host | |
| INVALID | back to summary |
|---|---|
| private static final int INVALID | |
| knownLang | back to summary |
|---|---|
| private static final String[] knownLang | |
| logStatus | back to summary |
|---|---|
| private volatile boolean logStatus | |
| MAX_CONNECT_TRYS | back to summary |
|---|---|
| private static final int MAX_CONNECT_TRYS | |
| NOT_GIVEN | back to summary |
|---|---|
| private static final int NOT_GIVEN | |
| portNumber | back to summary |
|---|---|
| private int portNumber | |
| server | back to summary |
|---|---|
| private NetworkServerControl server | |
| SERVLET_ADDRESS | back to summary |
|---|---|
| private static final String SERVLET_ADDRESS | |
| SERVLET_PROP_MESSAGES | back to summary |
|---|---|
| private static final String SERVLET_PROP_MESSAGES | |
| traceStatus | back to summary |
|---|---|
| private volatile boolean traceStatus | |
| tracingDirectory | back to summary |
|---|---|
| private volatile String tracingDirectory | |
| NetServlet | back to summary |
|---|---|
| public NetServlet() | |
| displayCurrentStatus | back to summary |
|---|---|
| private void displayCurrentStatus(LocalizedResource localUtil, String returnMessage, PrintWriter out) Display the current Network server status
| |
| doGet | back to summary |
|---|---|
| public synchronized void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException Overrides javax. Get the form of NetServlet. Provides buttons and forms to control the Network server.
| |
| doPost | back to summary |
|---|---|
| public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException Overrides javax. Get the form of NetServlet. Provides a buttons and form to control the Network server
| |
| escapeHTML | back to summary |
|---|---|
| private String escapeHTML(String str) Escapes potentially dangerous characters in data written to the browser. Note This is a poor mans implementation - it doesn't protect against all kinds of attacks, and it cannot be used in all contexts. | |
| escapeSingleQuotes | back to summary |
|---|---|
| private String escapeSingleQuotes(String str) If the received string has one or more single quotes in it, replace each one with the HTML escape-code for a single quote (apostrophe) so that the string can be properly displayed on a submit button.
| |
| fixLanguageCode | back to summary |
|---|---|
| private String fixLanguageCode(String lang) Fix the language code, as some browsers send then in a bad format (for instance, Firefox sends en-us instead of en_US). | |
| fixLanguageCode | back to summary |
|---|---|
| private String fixLanguageCode(String lang, int index) | |
| getCurrentAppUI | back to summary |
|---|---|
| private LocalizedResource getCurrentAppUI(HttpServletRequest request, String[] locale) Determine the locale file needed for this browsers preferences Defaults to the settings for derby.locale and derby.codeset if set English otherwise if browsers preferences can't be found
| |
| getDoAction | back to summary |
|---|---|
| private String getDoAction(HttpServletRequest request) throws IOException | |
| getForm | back to summary |
|---|---|
| private String getForm(HttpServletRequest request) throws IOException | |
| getHtmlLabelledMessageInstance | back to summary |
|---|---|
| private String getHtmlLabelledMessageInstance(LocalizedResource localUtil, String key, String id) get an HTML labelled message from the resource bundle file, according to the given key. | |
| getIntParameter | back to summary |
|---|---|
| private int getIntParameter(HttpServletRequest request, String name, String fieldKey, LocalizedResource localUtil, String returnMessage, PrintWriter out) Get an integer parameter
| |
| getLocStringFromLanguage | back to summary |
|---|---|
| private String getLocStringFromLanguage(String lang) Get locale string from language which may have qvalue set | |
| getLogging | back to summary |
|---|---|
| private String getLogging(HttpServletRequest request) throws IOException | |
| getParam | back to summary |
|---|---|
| private String getParam(HttpServletRequest request, String paramName) throws IOException get UTF8 parameter value and decode international characters
| |
| getServerStatus | back to summary |
|---|---|
| private boolean getServerStatus() Get the currrent server status by using test connection
| |
| getTrace | back to summary |
|---|---|
| private String getTrace(HttpServletRequest request) throws IOException | |
| init | back to summary |
|---|---|
| public void init(ServletConfig config) throws ServletException Overrides javax. Implements javax. Initialize the servlet. Configuration parameters:
| |
| isServerStarted | back to summary |
|---|---|
| private static boolean isServerStarted(NetworkServerControl server, int ntries) | |
| logging | back to summary |
|---|---|
| private boolean logging(LocalizedResource localUtil, boolean val, String returnMessage, PrintWriter out) Turn logging of connections on
| |
| printAsContentHeader | back to summary |
|---|---|
| private void printAsContentHeader(String str, PrintWriter out) Print the received string as a header.
| |
| printBanner | back to summary |
|---|---|
| private void printBanner(LocalizedResource localUtil, PrintWriter out) Print Derby Network Server banner | |
| printErrorForm | back to summary |
|---|---|
| private void printErrorForm(LocalizedResource localUtil, Exception e, String returnMessage, PrintWriter out) Display an error form
| |
| printErrorForm | back to summary |
|---|---|
| private void printErrorForm(LocalizedResource localUtil, String msg, String returnMessage, PrintWriter out) Display an error form
| |
| runServer | back to summary |
|---|---|
| private void runServer(LocalizedResource localUtil, String returnMessage, PrintWriter out) throws ServletException Start the network server and attempt to connect to it before returning
| |
| setDefaults | back to summary |
|---|---|
| private void setDefaults() Set defaults for logging and tracing (both off) | |
| setNetParam | back to summary |
|---|---|
| private boolean setNetParam(LocalizedResource localUtil, int max, int slice, String returnMessage, PrintWriter out) Set Network server parameters
| |
| shutdownServer | back to summary |
|---|---|
| private boolean shutdownServer(LocalizedResource localUtil, String returnMessage, PrintWriter out) Shutdown the network server
| |
| traceAll | back to summary |
|---|---|
| private boolean traceAll(LocalizedResource localUtil, boolean val, String returnMessage, PrintWriter out) Change tracing for all sessions
| |
| traceDirectory | back to summary |
|---|---|
| private boolean traceDirectory(LocalizedResource localUtil, String traceDirectory, String returnMessage, PrintWriter out) Set trace directory
| |
| traceSession | back to summary |
|---|---|
| private boolean traceSession(LocalizedResource localUtil, boolean val, int session, String returnMessage, PrintWriter out) Change tracing for a given session
| |
| translationAvailable | back to summary |
|---|---|
| private int translationAvailable(String lang) Check if the required translation is available
| |