You implement your design as a scriptlet by creating an XML (extensible markup language) file, which is much like a HTML file, but contains special elements that define the scriptlet and its behavior. The elements used for defining script components are not standard HTML tags. Instead, they are XML elements that are specifically used for scriptlet definitions.
When defining a scriptlet you create these elements:
If your scriptlet needs to access the built-in objects you must create an object that is bound to the ObjectContext. This is necessary because the scriptlet will not be compiled until your asp calls it. The following VBScript snippet demonstrates binding an object to ObjectContext and using the bound object to access the Response object.
Set objCurr = CreateObject("MTxAS.AppServer.1")
Set objCurrObjCont = objCurr.GetObjectContext()
Set vntResp = objCurrObjCont("Response")
The following example demonstrates using a scriptlet to send a response to the client.
<scriptlet>
<Registration
Description="Writer"
ProgID="Writer.Scriptlet"
Version="1.00"
>
</Registration>
<implements id=Automation type=Automation>
<method name=sendResponse>
</method>
</implements>
<script language=VBScript>
function sendResponse()
Dim objCurr
Dim objCurrObjCont
Dim vntResp
Set objCurr = CreateObject("MTxAS.AppServer.1")
Set objCurrObjCont = objCurr.GetObjectContext()
vntResp = objCurrObjCont("Response").Write ("Hello World")
end function
</script>
</scriptlet>
For more information on implementing a server scriptlet, see Encapsulating a Script's Logic in a Scriptlet.
To see an example of an ASP calling a server scriptlet see Developer Samples.