[英]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.