Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4504372
Votes 0
Synopsis JEditorPane can no longer render even simple HTML in JRE merlin-beta2
Category java_plugin:other
Reported Against merlin-beta2
Release Fixed 1.3.1_01(1.3.1_01a), 1.4(merlin-beta3) (Bug ID:2047255)
State 10-Fix Delivered, bug
Priority: 2-High
Related Bugs 4456393 , 4504375
Submit Date 19-SEP-2001
Description




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) 
======================================================================
Work Around
N/A
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.

  xxxxx@xxxxx   2001-09-19

  xxxxx@xxxxx   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


  xxxxx@xxxxx   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
Comments
  
  Include a link with my name & email   

Submitted On 20-SEP-2001
cforster
I'm thinking it might not be related to 4456393 because you 
can substitute:

 sampleURL = new URL(getCodeBase()+"simple.htm");

with a hard-coded URL (no codebase ref) of your choice, 
provide the applet the appropriate rights, and HTML will 
still not render in the JEP.  Also, my tests show that 
plaintext files, eg:

sampleURL = new URL(getCodeBase()+"sample.txt");

render fine in the JEP...  Think its more of a central HTML 
rendering issue...


Submitted On 21-SEP-2001
cforster
Re: "The HTML is not quite correct.  The closing </COMMENT> 
tag appears to be in the wrong place.  Perhaps that is part 
of the problem." -  OK, but that's in the applet calling 
HTML & not the HTML to be rendered... When you fix the 
COMMENT problem does the bug go away?



PLEASE NOTE: JDK6 is formerly known as Project Mustang