2015-07-01 42 views
0

我有一個配置文件頁面,並且我已經包含一個母版頁welcome.jsp。當我進入配置文件頁面時,歡迎頁面模板的CSS運行正常,但是由於我更新了用戶,用戶更新正確,requestDispatcher運行良好,但welcome.jsp的CSS運行不正常css運行時沒有運行requestDispatcher

code: profile.jsp

<html> 
<head> 
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 
    <title>Profile Page</title> 
<script src="//code.jquery.com/jquery-1.11.0.min.js"></script> 
<script src="//malsup.github.com/jquery.form.js"></script> 
    <script> 
    <jquery code> 
    </script> 
</head> 
<body> 
    <%@ include file="welcome.jsp"%> 

<center><h1>User Profile</h1></center><br><br> 

<form action="/devilmaycry/register?action=updateuser" method="post"> 
    <html code> 
</form> 

</body> 
</html> 

    `request dispatcher code` 

      rd=req.getRequestDispatcher("/Register/profile.jsp"); 
      rd.include(req, res); 
      pw.println("<h3>Record Updated !!!<h3>"); 

有人可以告訴我爲什麼CSS被禁用

着後期圖像,因爲低信譽:(

+0

這可能是一個尋路問題包含在包含的css文件中。仔細檢查你的路徑。 – briansol

+0

是的,我發現那一分鐘前,自己回答了問題 –

回答

0

我給的CSS文件的路徑爲relative,所以當RequestDispatcher的運行它改變了目錄,所以相對路徑沒有工作

分辨率 - >總是試圖給absolute路徑外部文件(的CSS,.JSP等)