TitleFirefox does not like escaped / char in URL
Date26-Jan-2005 05:08:13 EET
Version2.1.86 alpha
Submitter202.27.54.3
Bug criticalityMediumBug
Browser versionFirefox
Bug statusClosedBug
PageProvider used
Servlet ContainerTomcat 4.1.30
Operating SystemSolaris
URL
Java version1.4.2_05

When an image is inlined by JSPWiki it escapes the URL including the / char. This works in IE but causes Firefox to obtain a file from some cache somewhere, the file equates to the first version of any attached image.

In my case this is bad news since users are developing code based on the diagrams and firefox users will see old versions !!

The following change to com.ecyrd.jspwiki.TextUtil fixed the problem

   /**
     *  java.net.URLEncoder.encode() method in JDK < 1.4 is buggy.  This duplicates
     *  its functionality.
     */
    protected static String urlEncode( byte[] rs )
    {
        StringBuffer result = new StringBuffer();

        // Does the URLEncoding.  We could use the java.net one, but
        // it does not eat byte[]s.

        for( int i = 0; i < rs.length; i++ )
        {
            char c = (char) rs[i];

            switch( c )
            {
              case '_':
              case '.':
              case '*':
              case '-':
                result.append( c );
                break;
                //we dont want / escaped, it breaks urls in firefox
              case '/':
                  result.append( c );
                  break;

              case ' ':
                result.append( '+' );
                break;

etc

The fix is already in the current alpha release (2.1.144). Perhaps this would be able to explain BugStaleAttachments?

-- JanneJalkanen


Firefox is more stable anyway, even with 40 - 50 opened pages... wow!!!

--Nicolas, 27-Nov-2006

Add new attachment

Only authorized users are allowed to upload new attachments.
« This page (revision-9) was last changed on 06-Feb-2007 23:02 by JanneJalkanen