我将在我的Android应用程序中添加Spring的RESTful Web Service支持,如https://spring.io/guides/gs/consuming-rest-android/所述.
这是顶级的build.gradle配置:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
}
}
allprojects {
repositories {
jcenter()
}
}
Run Code Online (Sandbox Code Playgroud)
这是我的app/build.gradle
配置:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.example"
minSdkVersion 8
targetSdkVersion 17
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
dependencies {
compile 'com.android.support:appcompat-v7:+'
compile fileTree(dir: 'libs', include: ['*.jar']) …
Run Code Online (Sandbox Code Playgroud) 在我的Spring Boot应用程序中,我正在尝试配置自定义错误页面,例如对于404,我在应用程序配置中添加了以下Bean:
@Bean
public EmbeddedServletContainerCustomizer containerCustomizer() {
return new EmbeddedServletContainerCustomizer() {
@Override
public void customize(ConfigurableEmbeddedServletContainer container) {
container.addErrorPages(new ErrorPage(HttpStatus.NOT_FOUND, "/404.html"));
}
};
}
Run Code Online (Sandbox Code Playgroud)
另外,我创建了以下简单的Thymeleaf模板:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
<title>404 Not Found</title>
<meta charset="utf-8" />
</head>
<body>
<h3>404 Not Found</h3>
<h1 th:text="${errorCode}">404</h1>
<p th:utext="${errorMessage}">Error java.lang.NullPointerException</p>
<a href="/" th:href="@{/}">Back to Home Page</a>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
并将其添加到/resources/templates/
文件夹中.就在404错误我只能看到白屏.
我做错了什么以及如何正确设置我的404页面?此外,是否可以使用模板而不仅仅是自定义错误页面的静态页面?
我需要将所有用户请求从用户代理到域 A -> 到外部域 B。
另外,我需要在从 A 代理到 B 时引入一些自定义业务逻辑。
此自定义业务逻辑的任务之一 - 我需要动态处理 HTML 并在 HTML 中替换从域 B 到 A 的所有链接。此外,我需要代理 HTTP cookie,并且需要根据不同条件实现内容定位。
nginx 可以吗?那么,哪些语言可以用于自定义业务逻辑编写呢?我是一名 Java 开发人员,所以我主要对这种语言感兴趣,但也在寻找一种最有效的方法。
如果不是,您能否建议更适合此任务的替代方案。
在我的Neo4j/Spring Data Neo4j项目中,我有以下异常类:
public class CriterionNotFoundException extends NotFoundDomainException {
private static final long serialVersionUID = -2226285877530156902L;
public CriterionNotFoundException(String message) {
super(message);
}
}
Run Code Online (Sandbox Code Playgroud)
在应用程序启动期间,我看到以下WARN:
WARN o.s.d.n.m.Neo4jPersistentProperty - No identity field found for class of type: com.example.domain.dao.decision.exception.DecisionAlreadyExistsException when creating persistent property for field: null
Run Code Online (Sandbox Code Playgroud)
为什么Neo4j/SDN在这个类中寻找身份字段?如何正确配置我的应用程序以跳过此警告?
spring neo4j spring-data-neo4j spring-boot spring-data-neo4j-4
spring ×2
spring-boot ×2
android ×1
gradle ×1
java ×1
neo4j ×1
nginx ×1
proxy ×1
spring-mvc ×1
thymeleaf ×1