ASP on the WebSphere Application Server supports ActiveX Control embedded in Servlet. The following describes the methods and attributes of ActiveX control over AspToServlet.
This method is described as follows:
(1) String ExecServletToString (String servletName); execute ServletName and return its output to a String.
(2) ExecServlet (String servletName); execute ServletName and send its output directly to the HTML page.
(3) String VarValue (String varName); get a preset variable value (other formats ).
(4) VarValue (String varName, String newVal); set the variable value. The total size of a variable must be less than 0.5 characters
Section (Kbyte ). And only use these variables for the configuration file.
Its Attributes are as follows:
= Boolean WriteHeaders; if this attribute is true, the title provided by the Servlet is written to the user. The default value is false.
= Boolean OnTest; if this attribute is true, the server records the message to the generated HTML page. The default value is false.
The following ASP script example is written in Microsoft Visual Basic Scripting (VBScript.
<%
'Small sample asp file to show the capabilities of the servlets and the ASP GateWay...
%>
<H1> Starting the ASP-> Java Servlet demo </H1>
<%
'Create a Servlet gateway object and initialize it...
Set javaasp = Server. CreateObject ("AspToServlet. AspToServlet ")
'Setting these properties is only for the sake of demo.
'These are the default values...
Javaasp. OnTest = False
Javaasp. WriteHeaders = False
'Add several variables...
Javaasp. VarValue ("gal") = "lag"
Javaasp. VarValue ("pico") = "ocip"
Javaasp. VarValue ("tal") = "lat"
Javaasp. VarValue ("paz") = "zap"
Javaasp. VarValue ("variable name with spaces") = "variable value with spaces"
%>
<BR>
Lets check the variables
<%
Response. Write ("variable gal = ")
Response. Write (javaasp. VarValue ("gal "))
%>
<BR>
<%
Response. Write ("variable pico =" & javaasp. VarValue ("pico "))
%>
<BR>
<HR>
<%
Galout = javaasp. ExecServletToString ("SnoopServlet ")
If javaasp. WriteHeaders = True Then
%>
Headers were written <%
Else
%>
Headers were not written <%
End If
Response. Write (galout)
%>
<H1> The End... </H1>