Contidos dentro
Localizar Mais DocumentaçãoDestaques de Recursos de Suporte | Fazer download desta apostila em PDF (589 KB)
Chapter 4 Using the HTML Converter to Convert Applet Tags for Java Plug-inThis section includes the following topics: Note –
IntroductionThe Java Plug-in HTML Converter is a utility for converting an HTML page (file) containing applets to a format for Java Plug-in. The conversion process is as follows: First, HTML that is not part of an applet is transferred from the source file to a temporary file. Then, when an <APPLET> tag is reached, the converter parses the applet to the first </APPLET> tag (not contained in quotes) and merges the applet data with the template. If this completes without error, the original HTML file is moved to the backup folder and the temporary file is then renamed as the original file's name. The converter effectively converts the files in place. Thus, once the converter runs, files are setup for Java Plug-in. Running the GUI version of the HTML ConverterRunning the GUI version of the HTML ConverterThe HTML converter is located in the lib/htmlconverter.jar file inside the Java 2 SDK, Standard Edition, v1.4 installation. In the default package installation, this will be at /usr/j2se/lib/htmlconverter.jar. To launch the GUI version of the HTML Converter, do the following. At the command line, cd to <HTML Converter Directory>, then type
The HTML Converter window will appear: ![]() Choosing files within folders to convert: To convert all files within a folder, you may type in the path to the folder, or choose the browse button to select a folder from a dialog. Once you have chosen a path, you may supply any number of file specifiers in "Matching File Names". Each specifier must be separated by a comma. You may use * as a wildcard. Finally, if you would like all files in nested folders matching the file name to be converted, select the checkbox "Include Subfolders". Choosing a backup folder: The default backup folder path is the source path with an "_BAK" appended to the name; e.g., if the source path is /home/user1/html, then the backup path would be /home/user1/html_BAK. The backup path may be changed by typing a path in the field labeled "Backup Files to Folder:", or by browsing for a folder. Generating a log file: If you would like a log file to be generated, go to the Advanced Options screen (Edit->Options) and check "Generate Log File". Enter a path in the text field or browse to choose a folder. The log file contains basic information related to the converting process. Choosing a conversion template: A default template will be used if none is chosen. This template will produce converted html files that will work with Internet Explorer and Netscape browsers. If you would like to use a different template, you may choose it from the menu on the main screen. If you choose other, you will be allowed to choose a file to be used as the template. If you choose a file, be sure that it is a template. Choosing a version scheme: The specified version mentioned below is the version of the JRE you use to launch the converter; e.g., 1.4.0. The first two numbers in the version indicate the family; e.g., 1.4.3_02 is in the 1.4 family. For an explanation of product version numbers, see the note in the section called "Using OBJECT, EMBED and APPLET Tags in Java Plug-in."
Converting: Click the "Convert..." button to begin the conversion process. A dialog will show the files being processed, the number of files processed, the number of applets found, and number of errors. Exit or Convert More Files: When the conversion is complete, the button in the process dialog will change from "Cancel" to "Done". You may choose "Done" to close the dialog. You can then exit the Java Plug-in HTML Converter program, or select another set of files to convert. Details about templates: The template file is the basis behind converting applets. It is simply a text file containing tags that represent parts of the original applet. By adding/removing/moving the tags in a template file, you can alter the output of the converted file. Supported Tags:
Below are four templates that come with the HTML Converter. You can make up others and put them in the template folder to use them. default.tpl — the default template for the converter. The converted page can be used in Internet Explorer and Netscape Navigator browsers on Microsoft Windows platforms to invoke Java Plug-in. This template can also be used with the Netscape browser on the Solaris operating environment.
ieonly.tpl - the converted page can be used to invoke Java Plug-in in Internet Explorer on Microsoft Windows only.
nsonly.tpl - the converted page can be used to invoke Java Plug-in in Netscape Navigator browsers on Microsoft Windows platforms and the Solaris operating environment.
extend.tpl - the converted page can be used in any browser and any platform. If the browser is Internet Explorer or a Netscape Navigator browser on Microsoft Windows, or a Netscape Navigator browser on the Solaris operating environment, JavaTM Plug-in will be invoked. Otherwise, the browser's default virtual machine is used.
Running the converter from the command line:Running the converter from the command line:Format:
java -jar htmlconverter.jar [[filespecs]] [[-simulate]] [[-options1 value1 [-option2 value2 [...] ]] If only "java -jar htmlconverter.jar" is specified (no filespecs or options), the GUI version of the converter will be launched. Otherwise, the GUI will be suppressed. [[filespecs]]: space-delimited list of file specifications which may include wildcard (*), e.g. *.html, file*.html). [[simulate]]: Set to preview a conversion without actually doing the conversion. Use this option if you are unsuer about a conversion. You will be shown detail information about the conversion had it been done.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||