2016-09-30 39 views
0

我在github上有兩個分支。第二個是前端集成,並完美工作,直到我把它與主人合併。合併後處理爲html文件的Css文件

的index.jsp文件:

<%@ page contentType="text/html;charset=UTF-8" language="java" %> 
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 
<%@ taglib prefix="ex" uri="/WEB-INF/custom.tld" %> 

<html> 
<jsp:include page="pages/headFragment.jsp"/> 

<body> 
<body> 
... 
</body> 
</html> 

headFragment.jsp是:

<%@ page contentType="text/html;charset=UTF-8" language="java" %> 
<head> 
<!-- Animate.css --> 
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/animate.css"> 
    <!-- Icomoon Icon Fonts--> 
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/icomoon.css"> 
    <!-- Simple Line Icons --> 
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/simple-line-icons.css"> 
</head> 

在瀏覽器的控制檯,我有幾個誤區: 語法錯誤:預期表現,得到'<' 但它們與不是css文件的css文件相關聯。我的animate.css被瀏覽器解釋爲具有整個頁面主體的html文件。鏈接正常解釋,但他們的身體不是。

我認爲這是連接CSS樣式表的問題,但我GOOGLE了並嘗試了很多選項,沒有任何工作。有趣的部分是在前置集成部分它通常工作,但合併後它不包含css文件。還有用js文件的問題,但我想repare CSS首先...

而且,順便說一句,我就的IntelliJ 2016年2月4日

而且我的pom.xml工作文件:

<?xml version="1.0" encoding="UTF-8"?> 
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xmlns="http://maven.apache.org/POM/4.0.0" 
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 

    <groupId>webpage</groupId> 
    <artifactId>web_page</artifactId> 
    <version>1.0-SNAPSHOT</version> 
    <build> 
     <plugins> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-compiler-plugin</artifactId> 
       <configuration> 
        <source>1.8</source> 
        <target>1.8</target> 
       </configuration> 
      </plugin> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-war-plugin</artifactId> 
       <configuration> 
        <warSourceDirectory>web</warSourceDirectory> 
       </configuration> 
      </plugin> 
     </plugins> 
    </build> 
    <packaging>war</packaging> 

    <dependencies> 
     <!-- https://mvnrepository.com/artifact/postgresql/postgresql --> 
     <dependency> 
      <groupId>postgresql</groupId> 
      <artifactId>postgresql</artifactId> 
      <version>9.1-901.jdbc4</version> 
     </dependency> 

     <!-- http://repo1.maven.org/maven --> 
     <dependency> 
      <groupId>javax.servlet</groupId> 
      <artifactId>jstl</artifactId> 
      <version>1.2</version> 
     </dependency> 

     <!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api --> 
     <dependency> 
      <groupId>javax.servlet</groupId> 
      <artifactId>javax.servlet-api</artifactId> 
      <version>3.1.0</version> 
     </dependency> 

     <dependency> 
      <groupId>javax.servlet.jsp</groupId> 
      <artifactId>jsp-api</artifactId> 
      <version>2.1</version> 
      <scope>provided</scope> 
     </dependency> 

     <dependency> 
      <groupId>javax</groupId> 
      <artifactId>javaee-web-api</artifactId> 
      <version>7.0</version> 
      <scope>provided</scope> 
     </dependency> 

    </dependencies> 

</project> 

回答

0

對於誰可能關注。

問題出現在加載的servlet的全局歡迎路徑'/'中。將此路徑更改爲f.e. '/ yolo'解決了所有的衝突。