Moving static resources from WEB-INF to src/main/resources/static

This commit is contained in:
Antoine Rey 2016-10-23 12:12:42 +02:00
parent 104b4d2757
commit 80666d178d
36 changed files with 43 additions and 24 deletions

6
.gitignore vendored
View file

@ -1,7 +1,7 @@
target/*
.settings/*
target/
.settings/
.classpath
.project
.idea
*.iml
/target
generated/

View file

@ -30,6 +30,11 @@
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
@ -48,6 +53,7 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
<dependency>

View file

@ -0,0 +1,14 @@
package org.springframework.samples.petclinic.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
@Configuration
public class WebConfig extends WebMvcConfigurerAdapter {
@Override
public void addViewControllers(ViewControllerRegistry registry) {
registry.addViewController("/").setViewName("index");
}
}

View file

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 83 KiB

View file

Before

Width:  |  Height:  |  Size: 362 KiB

After

Width:  |  Height:  |  Size: 362 KiB

View file

Before

Width:  |  Height:  |  Size: 528 B

After

Width:  |  Height:  |  Size: 528 B

View file

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 66 KiB

View file

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 8.9 KiB

View file

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

View file

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

View file

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

View file

@ -38,6 +38,6 @@ petClinicApp.config(['$locationProvider', '$routeProvider', '$httpProvider', fun
var mod = 'layout' + c.toUpperCase().substring(0, 1) + c.substring(1);
angular.module(mod, []);
angular.module(mod).component(mod, {
templateUrl: "scripts/app/fragments/" + c + ".html"
templateUrl: "scripts/fragments/" + c + ".html"
});
});

View file

@ -1,6 +1,6 @@
<div class="container">
<div class="row">
<div class="col-12 text-center"><img src="/resources/images/spring-pivotal-logo.png"
<div class="col-12 text-center"><img src="/images/spring-pivotal-logo.png"
alt="Sponsored by Pivotal"/></div>
</div>
</div>

View file

@ -2,6 +2,6 @@
<div class="row">
<div class="col-md-12">
<img class="img-responsive" src="resources/images/pets.png" alt="pets logo" />
<img class="img-responsive" src="images/pets.png" alt="pets logo" />
</div>
</div>

View file

@ -5,7 +5,7 @@ angular.module('ownerDetails', [
]);
angular.module("ownerDetails").component("ownerDetails", {
templateUrl: "scripts/app/owner-details/owner-details.template.html",
templateUrl: "scripts/owner-details/owner-details.template.html",
controller: ["$http", '$routeParams', function($http, $routeParams) {
var self = this;

View file

@ -5,7 +5,7 @@ angular.module('ownerForm', [
]);
angular.module("ownerForm").component("ownerForm", {
templateUrl: "scripts/app/owner-form/owner-form.template.html",
templateUrl: "scripts/owner-form/owner-form.template.html",
controller: ["$http", '$routeParams', '$location', function ($http, $routeParams, $location) {
var self = this;

View file

@ -5,7 +5,7 @@ angular.module('ownerList', [
]);
angular.module("ownerList").component("ownerList", {
templateUrl: "scripts/app/owner-list/owner-list.template.html",
templateUrl: "scripts/owner-list/owner-list.template.html",
controller: ["$http", function ($http) {
var self = this;
$http.get('owner/list').then(function(resp) {

View file

@ -5,7 +5,7 @@ angular.module('petForm', [
]);
angular.module("petForm").component("petForm", {
templateUrl: "scripts/app/pet-form/pet-form.template.html",
templateUrl: "scripts/pet-form/pet-form.template.html",
controller: ["$http", '$routeParams', '$location', function ($http, $routeParams, $location) {
var self = this;
var ownerId = $routeParams.ownerId || 0;

View file

@ -5,7 +5,7 @@ angular.module('vetList', [
]);
angular.module("vetList").component("vetList", {
templateUrl: "scripts/app/vet-list/vet-list.template.html",
templateUrl: "scripts/vet-list/vet-list.template.html",
controller: ["$http", '$routeParams', function($http) {
var self = this;

View file

@ -5,7 +5,7 @@ angular.module('visits', [
]);
angular.module("visits").component("visits", {
templateUrl: "scripts/app/visits/visits.template.html",
templateUrl: "scripts/visits/visits.template.html",
controller: ["$http", '$routeParams', '$location', '$filter', function ($http, $routeParams, $location, $filter) {
var self = this;
var petId = $routeParams.petId || 0;

View file

@ -3,10 +3,10 @@
<html ng-app="petClinicApp">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=0, minimal-ui">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=0, minimal-ui"/>
<title>PetClinic :: a Spring Framework demonstration</title>
<link rel="stylesheet" href="webjars/bootstrap/3.3.7/css/bootstrap.min.css"/>
<link rel="stylesheet" href="resources/css/petclinic.css"/>
<link rel="stylesheet" href="../css/petclinic.css"/>
<script src="webjars/jquery/3.1.0/jquery.min.js"></script>
<script src="webjars/bootstrap/3.3.7/js/bootstrap.min.js"></script>
@ -14,13 +14,13 @@
<script src="webjars/angularjs/1.5.8/angular.min.js"></script>
<script src="webjars/angularjs/1.5.8/angular-route.min.js"></script>
<script src="scripts/app/app.js"></script>
<script src="scripts/app/owner-list/owner-list.component.js"></script>
<script src="scripts/app/owner-details/owner-details.component.js"></script>
<script src="scripts/app/owner-form/owner-form.component.js"></script>
<script src="scripts/app/pet-form/pet-form.component.js"></script>
<script src="scripts/app/visits/visits.component.js"></script>
<script src="scripts/app/vet-list/vet-list.component.js"></script>
<script src="../scripts/app.js"></script>
<script src="../scripts/owner-list/owner-list.component.js"></script>
<script src="../scripts/owner-details/owner-details.component.js"></script>
<script src="../scripts/owner-form/owner-form.component.js"></script>
<script src="../scripts/pet-form/pet-form.component.js"></script>
<script src="../scripts/visits/visits.component.js"></script>
<script src="../scripts/vet-list/vet-list.component.js"></script>
</head>
@ -28,7 +28,7 @@
<layout-nav></layout-nav>
<div class="container-fluid">
<div class="container xd-container">
<div ng-view></div>
<div ng-view=""></div>
</div>
</div>
<layout-footer></layout-footer>

View file

@ -1 +0,0 @@
generated/