那是因為你的css樣式檔案路徑出錯了,
樣式檔案路徑用<link href="<%=path %>/source/bookshop.css" target="_blank" rel="external nofollow" rel="stylesheet" type="text/css">
這樣無論如何都不會有問題 其中path你懂的,(request.getContextPath())
轉載:http://zhidao.baidu.com/link?url=PXf57O93vWo_-6vut6WyRREm4WWoceDqk781CgAdvnEK6s7ND8gp-rgeK7HWfYSksUfSbbCOb3lLZrtDivWjMq
我的代碼:
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
out.println(path);
out.println(basePath);
%>
<link rel="stylesheet" type="text/css" href="<%=path %>/manage/css/style.css" target="_blank" rel="external nofollow" />
<img src="<%=path %>/manage/images/touxiang.png" width="150px" height="150px">
<form action="<%=path %>/UserCheck" method="post">