1. To use RapidSpell Web, you must add the RapidSpellWeb.jar and RapidSpellMDict.jar files to the
lib directory of your web application.
2. Register a Servlet in your web.xml file. To do this;
i) Open web.xml under /web-inf (for an example of a complete web.xml file with this, please see the RapidSpellDemo application included with this product)
ii) Add this block (if other <servlet> sections exist, add it directly below them), inside the <web-app> elements.
<servlet>
<description>Handles requests for RapidSpell Web</description>
<servlet-name>RapidSpellWebHandlerServlet</servlet-name>
<servlet-class>com.keyoti.rapidSpell.web.ControlServlet</servlet-class>
<init-param>
<param-name>licenseKey</param-name>
<param-value></param-value>
</init-param>
</servlet>
iii) Add this block below it (if other <servlet-mapping> sections exist, add it directly below them)
<servlet-mapping>
<servlet-name>RapidSpellWebHandlerServlet</servlet-name>
<url-pattern>*.rapidspellweb</url-pattern>
</servlet-mapping>
iv) Add this block below it (if other <context-param> sections exist, add it below them) - this setting is explained in the user dictionary section.
Please note that in some server contexts (such as WAR files that are not 'exploded' on deployment) we may not be able to automatically resolve '~/' to the application root, in this case please set the param RapidSpellBaseDir.<context-param> <param-name>RapidSpellUserDictionaryDirs</param-name> <param-value>~/</param-value> </context-param><context-param> <param-name>RapidSpellBaseDir</param-name> <param-value>c:\path\to\app root\</param-value> </context-param>v) For an example of a complete web.xml file with this, please see the demo application included with the product.
3.
There are two ways to use RapidSpell Web; from Javascript or from JSP tags.
<script src="a.rapidspellweb?t=r&n=RapidSpell-AYT.js"></script>
<script src="a.rapidspellweb?t=r&n=RapidSpell-DIALOG.js"></script>
a.rapidspellweb is the servlet registered in your web.xml (see top of this page).
Add the taglib directive to the top of each page using the
tags.
<%@ taglib uri="http://www.keyoti.com/" prefix="RapidSpellWeb" %>
RapidSpell Web requires a license key to be set in the application, if a key is not set, the
component will only run when the application is accessed through “localhost”. Furthermore, if the
RapidSpellChecker class is used separately, it too must have a license key set (in it’s constructor).
Time limited evaluation keys can be generated automatically at
http://keyoti.com/products/evaluation-key-generator
If you have purchased licenses, please see the accompanying file “license-keys.txt” which explains in
detail how to generate “deployment keys”.
Open web.xml under /web-inf, and look for the RapidSpellWebHandlerServlet servlet (see top of this page), place the license key inside the <param-value> tags, for the
licenseKey property. Eg.
<init-param>
<param-name>licenseKey</param-name>
<param-value>12345</param-value>
</init-param>
(the web application server, or ‘container’ must be restarted after this change).
For multiple keys add extra licenseKey params, named; licenseKey2, licenseKey3 ... up to licenseKey6
The license key (deployment key) is set as follows, depending on which component is being used.
The key can be set in the licenseKey attribute in the RapidSpellWeb Tag (which is in the popup page),
eg;
<RapidSpellWeb:rapidSpellWeb licenseKey="......."/>
If setting multiple license keys, comma delimit them (with no spaces), eg "key1,key2,key3"
The key can be set in RapidSpellChecker’s constructor, eg;
RapidSpellChecker rapidSpellChecker = new RapidSpellChecker("........");
This component can be used/licensed in 2 ways and the key is set accordingly:
1. The standard/default way (when the rapidSpellWInlineHelperPage attribute in each
RapidSpellWInline tag is not set in the JSP page) -
Open web.xml under /web-inf, and look for the RapidSpellWebHandlerServlet servlet (see top of this page), place the license key inside the <param-value> tags, for the
licenseKey property. Eg.
<init-param>
<param-name>licenseKey</param-name>
<param-value>12345</param-value>
</init-param>
(the web application server, or ‘container’ must be restarted after this change).
2. If rapidSpellWInlineHelperPage is set in the RapidSpellWInline tag -
It is necessary to set the licenseKey attribute of the RapidSpellWInlineHelper tag (which is in the page
specified by the rapidSpellWInlineHelperPage property).
eg;
<RapidSpellWeb:rapidSpellWInlineHelper licenseKey="......."/>
Please see the user dictionary examples, for the inline and popup spell checkers, for important information on configuration.
To prevent exceptions being reported about problems loading the Dict File (which could be a security risk as it could provide information about the existence of system files), please disable warnings when deploying to production.
1. Set a paramter called RapidSpellHideDictFileExceptions
in web.xml to "true".
eg.
<?xml version="1.0" encoding="UTF-8"?> <web-app ...> <context-param> <param-name>RapidSpellHideDictFileExceptions</param-name> <param-value>true</param-value> </context-param> .... </web-app>