2017-04-05 1 views
0
<!DOCTYPE html> 
<html> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> 
<script type="text/javascript" src="../scripts/angular.min.js"></script> 
<script type="text/javascript" src="../scripts/jquery-3.2.0.js"></script> 
<link rel="stylesheet" type="text/css" href="../css/home.css"> 
<title>Hello</title> 
</head> 
<body> 
    <div id="d1"> 
    asfsdg 
    </div> 

</body> 
</html> 

jsp 페이지의 html 요소에 스타일을 추가하려고하지만 스타일을 추가하고 tomacat 9.0에서 실행하면 아무 것도 발생하지 않고 일반 텍스트 만 나타납니다. 그리고 페이지 소스로 이동하고 나에게 당신은 당신의 CSS를 이동할 수 있습니다 및 스크립트는 웹 콘텐츠 안에 폴더와 HTML/JSP의 경로를 제공JSP로 CSS를 추가 할 때 오류가 발생했습니다.

HTTP Status 404 – Not Found 

Type Status Report 

Message /TutorNextDoor/css/home.css 

Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. 

Apache Tomcat/9.0.0.M18 

enter image description here

+1

폴더 구조를 표시하는 게시물을 편집 하시겠습니까? 당신이 지금하고있는 것을 위해 당신의 JSP는 CSS 1과 같은 수준의 폴더 안에 있습니다. 맞습니까? –

+0

구조를 보여주는 이미지를 추가했습니다. –

+0

아니요 –

답변

0

오류가 표시 CSS에 대한 링크를 클릭 할 때 파일을 다음과 같은 방식으로 업로드하십시오.

<!DOCTYPE html> 
    <html> 
    <head> 
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> 
    <!-- Scripts --> 
    <script type="text/javascript" src="<%=request.getContextPath()%>/scripts/angular.min.js"></script> 
    <script type="text/javascript" src="<%=request.getContextPath()%>/scripts/jquery-3.2.0.js"></script> 
    <!-- CSS --> 
    <link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/css/home.css"> 
    <title>Hello</title> 
    </head> 
    <body> 
     <div id="d1"> 
      asfsdg 
     </div> 
    </body> 
    </html> 
관련 문제