This section explain how to use the asp2java command to convert your ASP application to Java source code or Java class files and run them on your web servers, in order to boost your ASP application executing speed. Please take a few minutes to read the following instructions carefully before using it.
1. Convert all ASP to Java file for the specific project.
Usage:java asp2java [option0/option1] <target>
Remark
option0 (Look at the example):
-v <virtual name1>=<local path1>[;<virtual name2>=<local path2>;...]
virtual name: the alias name which is registered in web server.
local path: the local path where virtual name is mapped, used for Virtual include statement.
";" charactor is used as the separator when there are 2 or more virtual applications.-a <application name1>=<local path1>[;<application name2>=<local path2>;...]
application name: the alias name which is registered in web server for current application.
local path: the local path where application name is aliased.
";" charactor is used as the separator when there are 2 or more applications to be convert in batch.
Note: If you have more than one global.asa files in your application(s), you should give the full path where the global.asa locates to application name and its full local path so that those globe.asp could take effect, look at this example.-r <application root local path>
specifies the Application root's local path. This is optional.
option1 (Look at the example):
-p <properties file>.<target>:properties file: the properties file's local path. This file includes the parameter -v and -a or -r, look at this virtual.properties file for instance.
If there are 2 or more virtual applications or aliased application under application root to convert, you should use -v0, -v1, ... -vn or -a0, -a1, ... -an to set them.The desdinated directory to place the generated java files. ('.' character represents the current directory)
NOTE: You can also type "java asp2java -?" or "java asp2java -help" to display the above help information.
Example#1:The following command line will convert all ASP files of test01 ASP application to Java files under c:/inetpub/wwwroot/test01 and test02 ASP application to Java files under c:/inetpub/wwwroot/test02 to d:/iasp/servlets:
And the parameter -v process the include statement: <!--#include virtual=/iasp/a.asp--> and <!--#include vitural=/samples/a.asp-->.java asp2java -v iasp=d:/aspsamples/iasp;sample=d:/aspsamples -a test01=c:/inetpub/wwwroot/test01;test02=c:/inetpub/wwwroot /test02 -r c:/inetpub/wwwroot d:/iasp/servlets
Parameter -a process the virtual applications: "http://<hostname>:[port number]/test01/a.asp" and "http://<hostname>:[port number]/test02/a.asp".
Parameter -r process the application root.The following command line will convert 2 subdirectories of test01 application which have their own global.asa to Java files under c:/inetpub/wwwroot/test01/general and c:/inetpub/wwwroot/test01/general/vbscript to d:/iasp/servlets:
java asp2java -a test01/general=c:/inetpub/wwwroot/test01/general; test01/general/vbscript=c:/inetpub/wwwroot/test01/general/vbscript d:/iasp/servletsFor Example#1, you can also define your virtual.properties file under d:/iasp/properties/, as the following lines and use Parameter -p to process the virtual name and alias name in this properties file:
-v0 iasp=d:/aspsample/iasp
-v1 sample=d:/aspsamples
-a0 test01=c:/inetpub/wwwroot/test01
-a1 test02=c:/inetpub/wwwroot/test02
-r c:/inetpub/wwwrootAnd run following command line:
java asp2java -p d:/iasp/properties/virtual.properties d:/iasp/servlets
2. Set classpath:
Set classpath in the system for generated java directory. (Example: set classpath to 'd:/iasp/servlets' directory.)
3. Run ASP file:
Restart your web server to run asp file.
NOTE: 1) If ASP file is changed, you should convert the source ASP files again, but this time will only generate java files for the changed source ASP files. This is a very helpful function for debugging your ASP application. 2) Each Conversion project generates a servlet file, the file name is defined as '_'+vritualName+'_Servlet.java', if virtualName is null, then the file name is defined as '_'+Application1_'Servlet.java' by default, the virtualName is parameter is the value of parameter -a. 3) If your ASP application assosciates to another or more ASP application, you may change the servlet's setting relatively. You must set the default servlet to the servlet 'util.ReleaseServlet'. 4) You can use this command to convert a single ASP file to a Java file but the generated Java class file can't be executed standalone.
If you encounter any problems or errors, please contact support@halcyonsoft.com.
Copyright © 1998-2000, Halcyon Software Inc. All rights reserved.