glassfish5 で実行されている jax-rs アプリの jsp ファイルに css と js を追加する必要があります。pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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>com.example</groupId>
<artifactId>elearning_ontology</artifactId>
<version>1.0-SNAPSHOT</version>
<name>elearning_ontology</name>
<packaging>war</packaging>
<properties>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
<junit.version>5.6.2</junit.version>
</properties>
<dependencies>
<dependency>
<groupId>javax.mvc</groupId>
<artifactId>javax.mvc-api</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>org.eclipse.krazo</groupId>
<artifactId>krazo-jersey</artifactId>
<version>1.1.0-M1</version>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>7.0</version>
</dependency>
<dependency>
<groupId>net.sourceforge.owlapi</groupId>
<artifactId>owlapi-distribution</artifactId>
<version>5.1.17</version>
</dependency>
<dependency>
<groupId>com.github.galigator.openllet</groupId>
<artifactId>openllet-owlapi</artifactId>
<version>2.6.5</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.3.0</version>
</plugin>
</plugins>
</build>
</project>
私は相対パスを使用してcssを追加しようとしましc:url
たが、チャンスはありません:
<link rel="stylesheet" href="<c:url value = "bootstrap-rtl.min.css"/>" media="screen">
<link rel="stylesheet" href="assets/css/bootstrap-rtl.min.css" media="screen">
ページのソースを表示して CSS の URL をクリックすると、404 ページが表示されます。Applicationまたは web.xmlを介して設定を行う必要があると思いますが、方法がわかりません
PS: これは、安静な mvcアプリ です。そのため、すべてのルートはコントローラ クラスを通じて制御されます。
そのため(おそらく)、コントローラーで定義されているか、構成ファイルで定義されているパスへのアクセスしかありません。相対パスまたは絶対パスは機能しません。