2016-09-30 41 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'解决了所有的冲突。