1

私はあなたが身震いすることを知っていますが、私ができるようにしたいことは次のとおりです。

ダウンロード時にhtmlを次のように表示したいと思います。

<t><r>
  <d c="b" s="w: 1px;"></d>
  <d c="i" s="w: 99px;"></d>
  <d c="t" s="w: 1px;"></d>
  <d c="u" s="w: 6px;"></d>
<r></t>

そして、ダウンロード後にJavaScriptで実際の取引に変更します:

<table><tr>
  <td class="b" style="width: 1px;"></td>
  <td class="i" style="width: 99px;"></td>
  <td class="t" style="width: 1px;"></td>
  <td class="u" style="width: 6px;"></td>
<tr></table>

これは可能ですか?

編集:8時間まで自分の質問に答えられないので、コードで答えます?!?!

わかりました、うまくいきます!

ルピーのコードは次のとおりです。

public static class Stats extends Service {
    public String path() { return "/stats.html"; }
    public void filter(Event event) throws Event, Exception {
        event.reply().header("Content-Encoding", "gzip");

        File file = new File("app/content/stats.html.gzip");
        file.createNewFile();

        GZIPOutputStream out = new GZIPOutputStream(new FileOutputStream(file));
        FileInputStream in = new FileInputStream("app/content/stats.html");

        Deploy.pipe(in, out);

        in.close();

        out.finish();
        out.close();

        in = new FileInputStream(file);

        Deploy.pipe(in, event.reply().output(file.length()));

        in.close();
    }
}

私のファイルはパフォーマンスを必要とするものではありません。その場合、もちろん、読み取りではなく書き込みでgzipします...

4

0 に答える 0