簡體   English   中英

運行requestDispatcher時CSS沒有運行

[英]css is not running while running requestDispatcher

我有一個個人資料頁面,並且其中包含一個母版頁面welcome.jsp 當我轉到個人資料頁面時,歡迎頁面模板的CSS運行正常,但是當我更新用戶時,用戶已正確更新, requestDispatcher運行良好,但是welcome.jsp的CSS運行不正常

代碼: 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被禁用

由於信譽低而無法發布圖片:(

我為CSS文件指定的路徑是relative路徑,因此當requestDispatcher運行時,它更改了目錄,因此相對路徑不起作用

分辨率->始終嘗試提供外部文件的absolute路徑(.css,.jsp等)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM