JDK-4717944 : HTMLConverter Template File does not work
  • Type: Bug
  • Component: deploy
  • Sub-Component: plugin
  • Affected Version: 1.4.1
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic,windows_98
  • CPU: generic,x86
  • Submitted: 2002-07-19
  • Updated: 2002-12-04
  • Resolved: 2002-11-13
Related Reports
Duplicate :  
Description
Platform:  Linux/solaris/windows
JDK release:   1.4.1-rc build 17

Steps to reproduce:

1) Install j2sdk1.4.1-rc-b17 onto the test system
2) Invoke HTMLConverter (bundled with the JDK)

/j2sdk1.4.1/bin/HtmlConverter -gui

3) Use the Template File :"Extended (Standard + All Browsers/Platforms)
to convert any demo applet in the /j2sdk1.4.1/demo

The convertered demos can not be loaded using IE or NS4.x.
(error: java.lang.ClasFormatError: Bad major version number)
It can only be loaded using NS 6 which uses <Appplet> tag

All converteded applets should have been loaded using NS4.x or IE when users convert using "Extended" template






Name: gm110360			Date: 08/06/2002


FULL PRODUCT VERSION :
java version "1.4.1-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-beta-b14)
Java HotSpot(TM) Client VM (build 1.4.1-beta-b14, mixed mode)


FULL OPERATING SYSTEM VERSION :
Windows 98 [Version 4.10.2222]


ADDITIONAL OPERATING SYSTEMS :

All?

A DESCRIPTION OF THE PROBLEM :
The HTMLConverter templates contain illegal javascript
and bad html.  This bug is related to bugs #4717944 and
#4638440, but the "comment" button in those bug reports
results in:
    400 Bad Request
    
    No comment data!
at URL:
http://developer.java.sun.com/servlet/BugVoteServlet

The document.writeln() methods contain a quoted string
with embedded newlines.  This is an incorrect textfile
encoding for DOS/Windows.  But even if you managed to
fix that, it is illegal to embed newlines in a quoted
string.  The embedded newlines ("\n") should be replaced
with "'\n+'" sequence (replace one character with four).

For the Windows platform the newlines should be replaced
with "\r\n" sequences.  (Since HTMLConverter is written
in Java, it should not be difficult to get and use the
value of the system property line.seperator when
generating output.

Additionally, the HTML is not legal HTML 4.01.  While I
realize HTMLConverter is for backward compatibility for
old browers, the generated code should be legal on all
browsers or the tool is worthless as a single HTML file
solution for multiple broswer support.  Some simple
changes are to use <script type="text/javascript>
instead of <SCRIPT LANGUAGE="JAVASCRIPT">.  The LANGUAGE
attribute is deprecated, and all tags and attribute
names should be in lowercase (because case only matters
when supporting xhtml, which requires lower case).  For
applet tag related purposes, the HTML 4.01 standard
seems backward compatible with HTML 3.2  (That is, the
incompatibilities such as the HR tag don't effect what
HTMLConverter needs.)

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. HTMLConverter
2. Select extended template (all browers and platforms)
3. Convert an applet tag

REPRODUCIBILITY :
This bug can be reproduced always.

CUSTOMER WORKAROUND :
Hand edit the resulting HTML files.
(Review ID: 160303)
======================================================================
###@###.### 2002-12-04

Tested with 1.4.2-b08 using template
"Extended (Standard + All Browsers/Platforms)"

on XP-Prof/RH/sparc 8 

The converted applets seems to be loaded fine.


Comments
EVALUATION This problem also occurs on Merlin. Committing to Mantis for resolution. ###@###.### 2002-07-23 The problem is that the line that contains the "EMBED" tag in the template file is plit across multiple physical lines and the "\" seem to be getting dropped out of the final html file. This results in a split of the sting literal (the browser doesn't find the closing quote). I recommend turning it into one line. ###@###.### 2002-07-24 This problems seems to be fixed in mantis, there was a changed related to another bug 4638440 that was putback. It does fix this problem, but it does not address all of the html specification issues. Close this as a dup of 4638440 and open a new one to look into the rest of the issues outlined in this bug. ###@###.### 2002-11-09 Closing as a dup of 4638440. the converted file appear to work. Will open new bug to follow up on other issues. Bug id # 4778451 The error " java.lang.ClasFormatError: Bad major version number" is likely generated by the 1.1 Vm trying to run a 1.3+ compiled applet. ###@###.### 2002-11-13
13-11-2002