JavaWeb

1、读取xml

 java.io.BufferedReader bis = new java.io.BufferedReader(
                new java.io.InputStreamReader(request.getInputStream()));

        String line = null;
        String result = "";
        try {
            while ((line = bis.readLine()) != null) {
                result += line + "\r\n";
            }
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            bis.close();
        }

2禁用浏览器缓存

 <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
 <meta http-equiv="Pragma" content="no-cache" />
 <meta http-equiv="Expires" content="0" />
<% response.setHeader( "Pragma", "no-cache" ); response.addHeader( "Cache-Control", "must-revalidate" ); response.addHeader( "Cache-Control", "no-cache" ); response.addHeader( "Cache-Control", "no-store" ); response.setDateHeader("Expires", 0); %>

你可能感兴趣的:(JavaWeb)