我是 OpenLayers(一个开源 JavaScript 库,用于在 Web 浏览器中将地图数据显示为滑动地图)的新手。我将它与 Thymeleaf(一个 Java XML/XHTML/HTML5 模板引擎,可以在 Web 和非 Web 环境中工作)一起使用。
我正在尝试重现此示例,但从服务器获取资源https://openlayers.org/en/latest/examples/reprojection-wgs84.html
我有这个页面:
<!doctype html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<title>Title</title>
<script src="https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.3.1/build/ol.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.3.1/css/ol.css">
<style>
.map {
width: 100%;
height:400px;
}
</style>
</head>
<body>
<div id="layout">
<div id="main">
<div class="content">
<div class="pure-g">
<div class="pure-u-1-1 pure-u-xl-10-24 pure-u-med-1">
<!-- Content right Wrap -->
<div class="content_r_wrap">
<!-- Devices Map Module -->
<div class="windowHead">
<h2>LOCATION INFO</h2>
</div>
<div class="windowContentMap">
<div id="map" class="map"></div>
<script th:inline="javascript" th:type="module">
/*<![CDATA[*/
import Map from …Run Code Online (Sandbox Code Playgroud) 我刚刚从 tomcat9 下载并部署了 activiti-app github.com/Activiti/Activiti/releases/download/activiti-6.0.0/\xe2\x80\xa6,但是在初始化应用程序时出现以下错误:
11:29:40,090 [http-nio-8080-exec-8] INFO org.activiti.app.conf.AsyncConfiguration - Creating Async Task Executor\n11:29:40,887 [http-nio-8080-exec-8] INFO org.activiti.app.conf.DatabaseConfiguration - Configuring Datasource\n11:29:40,910 [http-nio-8080-exec-8] INFO org.activiti.app.conf.DatabaseConfiguration - Configuring Datasource with following properties (omitted password for security)\n11:29:40,911 [http-nio-8080-exec-8] INFO org.activiti.app.conf.DatabaseConfiguration - datasource driver: org.h2.Driver\n11:29:40,911 [http-nio-8080-exec-8] INFO org.activiti.app.conf.DatabaseConfiguration - datasource url : jdbc:h2:mem:activiti;DB_CLOSE_DELAY=-1\n11:29:40,911 [http-nio-8080-exec-8] INFO org.activiti.app.conf.DatabaseConfiguration - datasource user name : sa\n11:29:40,911 [http-nio-8080-exec-8] INFO org.activiti.app.conf.DatabaseConfiguration - Min pool size | Max pool size | acquire increment : 10 | 100 | 5\n11:29:40,947 [http-nio-8080-exec-8] …Run Code Online (Sandbox Code Playgroud) 我有一个SpringBoot 2.0.2.RELEASE Web应用程序,带有这个配置文件:
@Override
protected void configure(HttpSecurity http) throws Exception {
final List<String> activeProfiles = Arrays.asList(env.getActiveProfiles());
if (activeProfiles.contains("dev")) {
http.csrf().disable();
http.headers().frameOptions().disable();
}
http
.authorizeRequests()
.antMatchers(publicMatchers()).permitAll()
.anyRequest().authenticated()
.and()
.formLogin().loginPage("/login").defaultSuccessUrl("/bonanza/list")
.failureUrl("/login?error").permitAll()
.and()
.logout().permitAll();
}
Run Code Online (Sandbox Code Playgroud)
我想添加一个基于自定义JWT的安全过滤器,仅用于匹配的Rest控制器/rest/**,所以我将配置修改为此文件,但现在我无法登录到应用程序,因为我有一个HTTP状态401 -擅自
@Override
protected void configure(HttpSecurity http) throws Exception {
final List<String> activeProfiles = Arrays.asList(env.getActiveProfiles());
if (activeProfiles.contains("dev")) {
http.csrf().disable();
http.headers().frameOptions().disable();
}
http
.exceptionHandling().authenticationEntryPoint(unauthorizedHandler).and()
// don't create session
.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and()
.authorizeRequests()
.antMatchers(publicMatchers()).permitAll()
.anyRequest().authenticated()
.and()
.formLogin().loginPage("/login").defaultSuccessUrl("/bonanza/list")
.failureUrl("/login?error").permitAll()
.and()
.logout().permitAll();
// Custom JWT based security filter
JwtAuthorizationTokenFilter authenticationTokenFilter = …Run Code Online (Sandbox Code Playgroud) OpenStreetMap中是否有任何函数可以让您从地址进行协调?
就像是
http://router.project-osrm.org/locate?request=GetGeocoding&nbaddresses=1&outputFormat=json&addresses_0=1240+Place+Jourdan+PARIS
Run Code Online (Sandbox Code Playgroud) 我正在设置这个变量
set srcDir = C:\Developpement\Workspaces\Eclipse\MyAuthenticationProvider\src
Run Code Online (Sandbox Code Playgroud)
然后我执行这个程序
java -DMJF=MyAuthentication.jar -Dfiles=%srcDir% weblogic.management.commo.WebLogicMBeanMaker
Run Code Online (Sandbox Code Playgroud)
但我有这个奇怪的错误
The specified input files directory, "%srcDir%", does not exist.
Run Code Online (Sandbox Code Playgroud)
我甚至尝试过使用
java -DMJF=MyAuthentication.jar -Dfiles=$srcDir weblogic.management.commo.WebLogicMBeanMaker
Run Code Online (Sandbox Code Playgroud)
结果相同
The specified input files directory, "$srcDir", does not exist.
Run Code Online (Sandbox Code Playgroud)
另一个测试:
C:\Developpement\Workspaces\Eclipse\WLAuthenticationProvider>set a=test
C:\Developpement\Workspaces\Eclipse\WLAuthenticationProvider>echo $a
$a
C:\Developpement\Workspaces\Eclipse\WLAuthenticationProvider>
Run Code Online (Sandbox Code Playgroud) 我有一个输入文本
<input type="text" id="usernameId" name="username" placeholder="User" />
Run Code Online (Sandbox Code Playgroud)
我想从属性文件中替换1个文本的占位符用户的文本,但我不知道是否可能
<input type="text" id="usernameId" name="username" placeholder="th:text="#{user.placeholder}"" />
Run Code Online (Sandbox Code Playgroud) 我有这样的代码段,其中,TDK是我在SpringBoot文件中定义的通用变量application.properties命名server.contextPath
我想知道是否有办法替换它
<head th:replace="tdk/common/header :: common-header" />
Run Code Online (Sandbox Code Playgroud)
就像是
<head th:replace="@environment.get('server.contextPath')/common/header :: common-header" />
Run Code Online (Sandbox Code Playgroud)
我在用
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
<version>1.5.3.RELEASE</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
我也尝试过:
<head th:replace="~{${@environment.getProperty('serverContextPath') + '/common/header'} :: common-header}" />
Run Code Online (Sandbox Code Playgroud)
结果如下:
org.thymeleaf.exceptions.TemplateInputException: Error resolving template "~{${@environment.getProperty('serverContextPath') + '/common/header'}", template might not exist or might not be accessible by any of the configured Template Resolvers (/tdk/registration/signup:6)
Run Code Online (Sandbox Code Playgroud) 我有一个基本的SpringBoot应用程序.嵌入式Tomcat,Thymeleaf模板引擎我想订购数据表的1个日期列.
在我的POJO中:
public String getTimeFormatted() {
DateTimeFormatter formatter =
DateTimeFormatter.ofPattern("EEEE, MMMM d,yyyy h:mm,a", Locale.ENGLISH);
LocalDateTime dateTime = LocalDateTime.ofEpochSecond(time, 0, ZoneOffset.UTC);
return dateTime.format(formatter);
}
Run Code Online (Sandbox Code Playgroud)
在模板中:
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.8.4/moment.min.js"></script>
<script src="https://cdn.datatables.net/plug-ins/1.10.15/sorting/datetime-moment.js"></script>
<script th:inline="javascript">
$(document).ready(function() {
$.fn.dataTable.moment( 'EEEE, MMMM d,yyyy h:mm,a' );
$('#table').dataTable( {
"bLengthChange": false,
"pageLength": 25,
});
} );
</script>
Run Code Online (Sandbox Code Playgroud)
我在SpringBoot应用程序的resources文件夹中有这个文件夹.
resources/files/a.txt
resources/files/b/b1.txt
resources/files/b/b2.txt
resources/files/c/c1.txt
resources/files/c/c2.txt
Run Code Online (Sandbox Code Playgroud)
我想得到所有的txt文件,所以这是我的代码:
ClassLoader classLoader = this.getClass().getClassLoader();
Path configFilePath = Paths.get(classLoader.getResource("files").toURI());
List<Path> atrackFileNames = Files.list(configFilePath)
.filter(s -> s.toString().endsWith(".txt"))
.map(Path::getFileName)
.sorted()
.collect(toList());
Run Code Online (Sandbox Code Playgroud)
但我只得到文件a.txt
thymeleaf ×4
spring-boot ×3
html ×2
java ×2
activiti ×1
alfresco ×1
collections ×1
css ×1
datatable ×1
datatables ×1
geolocation ×1
h2 ×1
java-8 ×1
javascript ×1
jquery ×1
jwt ×1
openlayers ×1
rest ×1
spring ×1
stream ×1
tomcat9 ×1
xcode6 ×1