![]() |
Accessing Built-In Objects Via Customized Components |
|
|||
If a customized component requires access to built-in objects, it must extend halc.com.iASPContext. iASPContext provides three methods (getServer(), getRequest(), getResponse()), and you can retrieve the parent of any built-in object from a customized component by calling these methods directly. There are two types of syntax you can use to accomplish this:
Server.CreateObject (ProgID [,ProgID Constructor parameter list])EXAMPLE (where ProgName.java is a customized component) package Demo; public class ProgName{ public String name = "sssssss"; public ProgName(String s,Double d) { name = s; } }
Remarks: Before creating an instance of Demo.ProgName.class, your CLASSPATH must contain Demo.ProgName.class and you must add the following code to the .asp file: <% set progname = Server.CreateObject("Demo.ProgName","winapp",3.456) %> As described above, if both and exist, represents a bean. If only exists, it represents a class. If does not exist, it is considered a VisiBroker Corba object name. ServerCreateObject (*.jar,[ProgID[,ProgID Constructor parameter list]])When using this syntax, it is not necessary for the .jar to be located
in the CLASSPATH, but it should exist in the virtual site. The Server.CreateObject (*.jar) syntax lets you browse all beans contained in the .jar file as well as their properties and methods. For programming details, please consult the Samples/General/CreateObject sample. ProgID represents the bean contained in the jar file. <% set explicit = Server.CreateObject("..\jar\buttons.jar","sunw.demo.buttons.ExplicitButton") %> NOTE: ProgID is case-sensitive but the fields and methods of ProgID are not case-sensitive. If you encounter any problems or errors, please contact support@halcyonsoft.com |
|||
|
|||
Copyright © 1998-2002, Halcyon Software Inc. All rights reserved. |