You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2004/02/25 14:31:02 UTC

DO NOT REPLY [Bug 25448] - jsp:include is intolerant of whitespace

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25448>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25448

jsp:include is intolerant of whitespace





------- Additional Comments From ctolkmit@tng.de  2004-02-25 13:31 -------
Ok - for all people that have this problem and have access to perl, here is a
small script to fix the problem. It reads the names of jsp files from stdin and
changes the <jsp:include's> accordingly. That is, only the ones where page=""
comes before flush="" - should be easy to change though.

#!/usr/bin/perl

use IO::AtomicFile;
use strict;

while(<STDIN>) {
    my $fileName = $_;
    chomp $fileName;
    print "processing $fileName\n";
    processFile($fileName);
}

exit 0;

sub processFile {
    my $fileName = shift;
    my $fileContent;
    open(IN,"<$fileName") or die("$fileName: $!");
    while(<IN>) {
	$fileContent .= $_;
    }
    close(IN);
    $fileContent =~ 
	s/\<jsp\:include\s+page\s*=\s*\"(.+?)\"\s+flush\s*=\s*\"(.+?)\"\s*\>\s*\<\/jsp:include\s*\>/<jsp:include
page="$1" flush="$2"\/>/msg;

    my $FH = IO::AtomicFile->open("$fileName","w");
    print $FH $fileContent;
    $FH->close || warn ( "write atomic $fileName: $!");
}

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org