在tomcat/webapps/test/images/下有图片1.GIF
用绝对路径则大小写不敏感,而用相对路径只能写images/1.GIF,如果写images/1.gif则找不到图片,这算是个bug吗?
PrintWriter pw = response.getWriter();
pw.println("<html>");
pw.println("<body>");
pw.println("<h1>用户登录界面</h1>");
pw.println("<img src='F:/Program Files/apache-tomcat-5.5.29/webapps/test/images/1.gif' ><br>");
pw.println("<form action = deal method = post>");
pw.println("用户名:<input type = text name = username> <br>");
pw.println("密码:<input type = password name = password> <br>");
pw.println("<input type = submit value = login> <br>");
pw.println("</form>");
pw.println("</body>");
pw.println("</html>");
用绝对路径则大小写不敏感,而用相对路径只能写images/1.GIF,如果写images/1.gif则找不到图片,这算是个bug吗?
PrintWriter pw = response.getWriter();
pw.println("<html>");
pw.println("<body>");
pw.println("<h1>用户登录界面</h1>");
pw.println("<img src='F:/Program Files/apache-tomcat-5.5.29/webapps/test/images/1.gif' ><br>");
pw.println("<form action = deal method = post>");
pw.println("用户名:<input type = text name = username> <br>");
pw.println("密码:<input type = password name = password> <br>");
pw.println("<input type = submit value = login> <br>");
pw.println("</form>");
pw.println("</body>");
pw.println("</html>");
HTML本身大小写不敏感,但加载图片调用操作系统的文件处理系统加载文件,这个时候有可能是大小写敏感的。