【发布时间】:2013-10-27 14:57:52
【问题描述】:
我有一个 Google App Engine (1.8.5) 项目。我想通过Webjars 提供静态 Javascript 和 CSS。但是,我不断收到HTTP 404 错误。如何使我的 Webjars 文件可访问?
我的 src/main/webapp/WEB-INF/appengine-web.xml 来自 Google 的 documentation:
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
...
<static-files>
<include path="/resources/**" />
<include path="/webjars/**" />
</static-files>
</appengine-web-app>
我的src/main/webapp/index.html,引用Webjars 提供的Bootstrap CSS 文件:
<html>
<head>
<link rel="stylesheet" href="webjars/bootstrap/3.0.0/css/bootstrap.min.css">
</head>
...
</html>
pom.xml 的片段:
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>(lots)</artifactId>
<version>1.8.5</version>
</dependency>
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>4.0-beta</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<scope>provided</scope>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>bootstrap</artifactId>
<version>3.0.0</version>
</dependency>
这是我在 GAE 发布的第一个问题,所以我不确定要提供哪些额外信息——请保持温和,所以。
【问题讨论】:
标签: java google-app-engine maven webjars