小编Al *_*ant的帖子

JavaFXPlugin 编译错误(Java 版本)

我正在尝试从 ArcGIS github here运行一些示例代码。

当我导入并尝试在 IntelliJ Community 2019 中运行该项目时,出现错误:

原因:org/openjfx/gradle/JavaFXPlugin 已经被更新版本的 Java Runtime(class 文件版本 55.0)编译,这个版本的 Java Runtime 只能识别到 52.0 的类文件版本

我的 build.gradle:

plugins {
    id 'application'
    id 'org.openjfx.javafxplugin' version '0.0.8'
}

ext {
    arcgisVersion = '100.6.0'
}

repositories {
    jcenter()
    maven {
        url 'https://esri.bintray.com/arcgis'
    }
}

configurations {
    natives
}

dependencies {
    compile "com.esri.arcgisruntime:arcgis-java:$arcgisVersion"
    natives "com.esri.arcgisruntime:arcgis-java-jnilibs:$arcgisVersion"
    natives "com.esri.arcgisruntime:arcgis-java-resources:$arcgisVersion"
}

javafx {
    version = "11.0.1"
    modules = [ 'javafx.controls' ]
}

task copyNatives(type: Copy) {
    description = "Copies the arcgis …
Run Code Online (Sandbox Code Playgroud)

java intellij-idea

13
推荐指数
1
解决办法
5294
查看次数

Springboot - 资源解释为样式表,但使用MIME类型text/htm进行传输

我之前看到了这个问题的一些答案,但我尝试过的解决方案都没有.

login.css没有login.html在我的Spring Boot应用程序中应用.我也在使用Thymeleaf.

安全性已打开 - 但我不认为这是浏览器中的问题.我没有看到加载失败login.css- 只有消息:

资源解释为样式表但使用MIME类型text/html传输:

浏览器中的进一步检查显示它正在请求text/css,但得到text/html响应.

html:

<!doctype html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4">

<head>

<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatiable" content="IE-Edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="Login"/>


<title>LOGIN</title>

<!-- Latest compiled and minified CSS -->

....
<link rel="stylesheet" href="login.css" content-type="text/css"/>
Run Code Online (Sandbox Code Playgroud)

的路径 login.html

\src\main\resources\templates\login.html
Run Code Online (Sandbox Code Playgroud)

的路径 login.css

\src\main\resources\static\login.css
Run Code Online (Sandbox Code Playgroud)

以防万一这是一个权限问题,我把:

.antMatchers("/css/**").permitAll()
Run Code Online (Sandbox Code Playgroud)

我注意到通过CDN提供的所有CSS都没有问题.另外,浏览器返回login.css一个302个状态码.

谢谢

css spring spring-mvc thymeleaf spring-boot

7
推荐指数
1
解决办法
4846
查看次数

使用QueryDSL 4.1.4和Intellij进行Gradle

我试图在Spring-Boot 1.5.2项目中重新获得queryDSL 1.4.1的Q类.IDE是Intellij Ultimate.

的build.gradle

buildscript {
ext {
    springBootVersion = '1.5.2.RELEASE'
    }
repositories {
    mavenCentral()
    }
dependencies {
    classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
    }
}

plugins {
    id 'net.ltgt.apt' version '0.8'
    id 'java'
}

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
apply plugin: 'idea'

version = '0.0.5-SNAPSHOT'
sourceCompatibility = 1.8

ext {
    queryDslVersion = '4.1.4'
    javaGeneratedSources = file("$buildDir/generated-sources/java")
}

compileJava {
    doFirst {
        javaGeneratedSources.mkdirs()
    }
    options.compilerArgs += [
            '-parameters', '-s', javaGeneratedSources
    ]
}

idea {
    module {
        sourceDirs += file('generated/')
        generatedSourceDirs …
Run Code Online (Sandbox Code Playgroud)

spring intellij-idea gradle querydsl spring-boot

2
推荐指数
1
解决办法
3906
查看次数

控制器(Web请求/ antMatcher)安全性与方法(服务)级安全性

在Spring Security中,我看到URL具有以下安全性:

http
    .authorizeRequests()
        .antMatchers("/admin").hasRole("ADMIN");
Run Code Online (Sandbox Code Playgroud)

我还看到有方法级别的安全性:

@PreAuthorize("hasRole('ADMIN')")
Run Code Online (Sandbox Code Playgroud)

antMatchers用于保护URL的安全性,还是@PreAuthorize用于保护接口的安全性?

如果已经antMatcher保护了调用接口的URL,那么为什么需要单独保护接口方法呢?

您能否在控制器上使用方法级别的安全性,例如:

@PreAuthorize("hasRole('ADMIN')")
@GetMapping("/dashboard/person")
public String findEvent(Model model, HttpServletRequest request) {
....
Run Code Online (Sandbox Code Playgroud)

java spring-mvc spring-security

2
推荐指数
1
解决办法
744
查看次数

Angular Error error TS2532: Object is possibly 'undefined'

I have been unable to find why I am getting this error on a Angular project.

Plan contains and array of Tasks. Each Task contains an entity called MetaTime. MetaTime has a field TaskStart.

plan.usergen.model.ts

import { Moment } from 'moment';
import {ITaskUsergen} from "app/shared/model/task.usergen.model";

export interface IPlan {
  id?: number;
  name?: string;
  startDate?: Moment;
  tasks?: ITaskUsergen[];
}

export class Plan implements IPlan {
  constructor(
    public id?: number,
    public name?: string,
    public startDate?: Moment,
    public tasks?: ITaskUsergen[],
  ) {}
} …
Run Code Online (Sandbox Code Playgroud)

java spring jhipster angular

1
推荐指数
1
解决办法
2484
查看次数