Index: src/gnu/gcjwebplugin/AppletTag.java =================================================================== RCS file: /sources/gcjwebplugin/gcjwebplugin/src/gnu/gcjwebplugin/AppletTag.java,v retrieving revision 1.28 diff -u -r1.28 AppletTag.java --- src/gnu/gcjwebplugin/AppletTag.java 17 Apr 2006 16:27:32 -0000 1.28 +++ src/gnu/gcjwebplugin/AppletTag.java 17 Apr 2006 18:11:04 -0000 @@ -130,8 +130,7 @@ try { - String tmpCodeBase = code.substring( - 0, + String tmpCodeBase = code.substring(0, code.lastIndexOf(File.separatorChar) + 1); if (tmpCodeBase.startsWith(File.separator)) documentbase = new URL("file", "", tmpCodeBase); @@ -239,6 +238,11 @@ document = (DomHTMLDocument) (new DomHTMLParser(HTML_401F.getInstance()).parseDocument(in)); } + /** + * Constructs an AppletTag and parses the given applet element. + * + * @param appElement - the Applet element to parse. + */ AppletTag(DomHTMLAppletElement appElement) { name = appElement.getName(); @@ -338,6 +342,8 @@ /** * Parses the param elements for a given node. + * + * @param node - the node element to parse. */ void parseParams(DomNode node) { @@ -753,13 +759,14 @@ URL tmpDocumentBase = null; try - { + { // Try parsing location as a URL. tmpDocumentBase = new URL(location); - + // If no file was specified in the URL the assume the user // meant the root page. - if (tmpDocumentBase.getFile().equals("")) + String f = tmpDocumentBase.getFile(); + if (f.indexOf(".") == -1 && !f.endsWith(File.separator)) tmpDocumentBase = new URL(location.concat(File.separator)); } catch (MalformedURLException e)