You are here: Home > QuestAgent8 > PublishersGuide > AppletInitParams

Search Applet Initialization Parameters

Search applet parameters can be defined in either HTML page (as a part of applet definition) or in a separate file.

A typical search applet definition looks like this:

 <APPLET
 CODE = "com.jobjects.quest.agent.SearchApplet"
 CODEBASE = "."
 ARCHIVE = "qagent.jar"
 ID = "QuestAgent"
 NAME = "QuestAgent"
 WIDTH = 600
 HEIGHT = 320
 MAYSCRIPT
 >
 <PARAM NAME="DefaultsFile" VALUE="defaults.prm">
 <PARAM NAME="ParamFile" VALUE="qagent.prm">
 </APPLET>

As APPLET tag has been deprecated by HTML specification, you can also use an appropriate OBJECT tag. In order to provide higher level of flexibility, QuestAgent JavaScript API creates dynamicaly creates HTML fragment (with either APPLET or OBJECT tag) using JavaScript.

Notice ParamFile applet parameter that defines file with additional parameters. Parameter file provides greater level of flexibility and easier reuse of settings among different search pages. (Note that parameter specified in applet tag overrides the same parameter defined in parameter file.)

Parameters in prm file are expected in the following format:

 # Comment
 param_name=parameter value

To specify the same parameter directly in your HTML page, add the following line between the opening <applet> tag and the closing </applet> tag:

 <param name="param_name" value="parameter value">

In this guide we use former for simplicity.

tip Parameters can be specified in either parameter files or applet definition. If the same parameter is specified on both places, applet parameter overrides the one from parameter file.