File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 7171 <artifactId >bootstrap</artifactId >
7272 <version >${webjars-bootstrap.version} </version >
7373 </dependency >
74+ <dependency >
75+ <groupId >org.jscience</groupId >
76+ <artifactId >jscience</artifactId >
77+ <version >4.3.1</version >
78+ </dependency >
7479 <dependency >
7580 <groupId >org.webjars</groupId >
7681 <artifactId >webjars-locator</artifactId >
8590
8691 <build >
8792 <plugins >
93+ <plugin >
94+ <artifactId >maven-assembly-plugin</artifactId >
95+ <version >3.0.0</version >
96+ <configuration >
97+ <descriptorRefs >
98+ <descriptorRef >jar-with-dependencies</descriptorRef >
99+ </descriptorRefs >
100+ <finalName >helloworld</finalName >
101+ </configuration >
102+ </plugin >
88103 <plugin >
89104 <groupId >org.springframework.boot</groupId >
90105 <artifactId >spring-boot-maven-plugin</artifactId >
Original file line number Diff line number Diff line change 1- /*
1+
22 * Copyright 2002 -2014 the original author or authors .
33 *
44 * Licensed under the Apache License , Version 2.0 (the "License ");
3333import java.sql.Statement;
3434import java.util.ArrayList;
3535import java.util.Map;
36+
37+ import static javax.measure.unit.SI.KILOGRAM;
38+ import javax.measure.quantity.Mass;
39+ import org.jscience.physics.model.RelativisticModel;
40+ import org.jscience.physics.amount.Amount;
41+ /*
3642
3743@Controller
3844@SpringBootApplication
3945public class Main {
4046
47+ @RequestMapping(" /hello ")
48+ String hello(Map<String, Object> model) {
49+ RelativisticModel.select();
50+ Amount<Mass> m = Amount.valueOf(" 12 GeV ").to(KILOGRAM);
51+ model.put(" science ", " E =mc ^2 : 12 GeV = " + m .toString ());
52+ return "hello" ;
53+ }
54+
4155 @ Value ("${spring.datasource.url}" )
4256 private String dbUrl ;
4357
Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < html xmlns:th ="http://www.thymeleaf.org " th:replace ="~{fragments/layout :: layout (~{::body},'hello')} ">
3+ < body >
4+ < div class ="container ">
5+ < p th:text ="${science} "/>
6+ </ div >
7+ </ body >
8+ </ html >
You can’t perform that action at this time.
0 commit comments