JDK-4504372 : JEditorPane can no longer render even simple HTML in JRE merlin-beta2
  • Type: Bug
  • Component: deploy
  • Sub-Component: plugin
  • Affected Version: 1.4.0
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_95
  • CPU: x86
  • Submitted: 2001-09-19
  • Updated: 2001-10-19
  • Resolved: 2001-09-27
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other Other
1.3.1_01 01aFixed 1.4.0Fixed
Related Reports
Duplicate :  
Relates :  
Description

Name: yyT116575			Date: 09/18/2001


Java(TM) Plug-in:Version 1.4.0
Using JRE version 1.4.0-beta2 java HotSpot(TM) Client VM

JEditorPane cannot render even the simplest HTML from a URL in the merlin-beta2.

Put the class files, HTML loader & simple.htm on a web server & try under 1.3.X
and the latest 1.4 beta2...  Yields link text of simple.htm under 1.3.X and file not
found under 1.4.0 Beta2 - b77...

HTMLinJEP.java  ===========
import javax.swing.*;
import javax.swing.event.*;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import java.text.*;
import java.net.*;

public class HTMLinJEP extends JApplet  {
  static URL sampleURL = null;
  static String startup = "View HTML";
    
  public void init() {
    try {
      System.out.println("========  Applet Init  ==========");
      sampleURL = new URL(getCodeBase()+"simple.htm");
    } catch (Exception exc) {
      startup = "Error in init:"+exc;
      System.out.println(startup);
    }
    
    getContentPane().setLayout(new BorderLayout());
    final JDesktopPane desktop = new JDesktopPane();
    
    JInternalFrame makeFrame = new JInternalFrame("Frame Maker",true,false,true,true);
   
    JButton button = new JButton(startup);
    button.addActionListener(new ActionListener() {
      public void actionPerformed(java.awt.event.ActionEvent event) {
        final JInternalFrame internal = new JInternalFrame("Frame",true,true,true,true);
        JEditorPane epOutput = null;
        try {
          epOutput = new JEditorPane();
          epOutput.setPage(sampleURL);
        } catch (Throwable eee) {
          System.out.println("Unable to set editorpane to URL:"+eee);
        }
        internal.getContentPane().add(epOutput,BorderLayout.CENTER);
        internal.setBounds(25,25,250,200);
        internal.setVisible(true);
        desktop.add(internal);
        repaint();
      }
    });
    makeFrame.getContentPane().add(button,BorderLayout.CENTER);
   
    desktop.add(makeFrame);
    makeFrame.setVisible(true);
    getContentPane().add(desktop,BorderLayout.CENTER);
    makeFrame.setBounds(300,50,300,100);
    getContentPane().validate();
    getContentPane().setVisible(true);
  }
}

HTMLinJEP.html  =============
<html>
<OBJECT id="JApplet" classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
WIDTH = 100% HEIGHT = 100%
codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0">
<PARAM NAME = CODE VALUE = HTMLinJEP.class >
<PARAM NAME="type" VALUE="application/x-java-applet;version=1.3">
<COMMENT>
<EMBED type="application/x-java-applet;version=1.3" 
java_CODE = HTMLinJEP.class WIDTH = 100% HEIGHT = 100%
pluginspage="http://java.sun.com/products/plugin/1.3/plugin-install.html">
<NOEMBED>
</COMMENT>
alt="Your browser understands the tag but isn't running the applet, for some
reason (Java Plug-In 1.3.0+ not available?)."
Your browser is completely ignoring the applet tag!
</NOEMBED>
</EMBED>
</OBJECT>
</html>

Simple.htm ================
<html>
<head>
<title>Web HTML Setup and Access </title>
</head>
<body>
<BR>
<a HREF="Splash.html">Press here to access</a><BR> <BR>
</body>
</html>
(Review ID: 131946) 
======================================================================

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: 1.3.1_01a merlin-beta3 FIXED IN: 1.3.1_01a merlin-beta3 INTEGRATED IN: 1.3.1_01a merlin-beta3
14-06-2004

EVALUATION The HTML is not quite correct. The closing </COMMENT> tag appears to be in the wrong place. Perhaps that is part of the problem. ###@###.### 2001-09-19 ###@###.### 2001-09-20 I just tested on Solaris and Window NT platform, using merlin B79 and B70, both works fine without any problem. I am using Netscape 4.75 You can try it to hit my web server at following URL: http://sarcasm.east:8888/dennis/bug/4504372/HTMLinJEP.html The class file HTMLinJEP.class must be in the same directory as HTMLinJEP.html and simple.htm, this probably a user error. Dennis Gu ###@###.### 2001-09-21 This is a bug in Java plugin 1.4 It only happened when you put your HTML file diretly under DocumentRoot dir of your web server. getCodeBase() didn't return correct vlaue. I have put a fix in AppletViewer.java file. It will solve the problem. Dennis Gu
11-06-2004