mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-09-17 20:19:06 +00:00
Merge branch '3.5.x' into 4.0.x
Closes gh-49714
This commit is contained in:
+2
-1
@@ -115,7 +115,8 @@ javadoc:org.springframework.boot.context.properties.ConfigurationProperties[form
|
||||
data class KotlinExampleProperties(
|
||||
val name: String,
|
||||
val description: String,
|
||||
val myService: MyService) {
|
||||
val myService: MyService
|
||||
) {
|
||||
|
||||
data class MyService(
|
||||
val apiToken: String,
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ public class MyErrorViewResolver implements ErrorViewResolver {
|
||||
// Use the request or status to optionally return a ModelAndView
|
||||
if (status == HttpStatus.INSUFFICIENT_STORAGE) {
|
||||
// We could add custom model values here
|
||||
new ModelAndView("myview");
|
||||
return new ModelAndView("myview");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
+3
-2
@@ -29,8 +29,9 @@ class MyConditionEvaluationReportingTests {
|
||||
fun autoConfigTest() {
|
||||
ApplicationContextRunner()
|
||||
.withInitializer(ConditionEvaluationReportLoggingListener.forLogLevel(LogLevel.INFO))
|
||||
.run { context: AssertableApplicationContext? -> }
|
||||
.run { context: AssertableApplicationContext? ->
|
||||
// Test something...
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
+5
-9
@@ -16,17 +16,13 @@
|
||||
|
||||
package org.springframework.boot.docs.using.devtools.restart.disable
|
||||
|
||||
import org.springframework.boot.SpringApplication
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication
|
||||
import org.springframework.boot.runApplication
|
||||
|
||||
@SpringBootApplication
|
||||
object MyApplication {
|
||||
|
||||
@JvmStatic
|
||||
fun main(args: Array<String>) {
|
||||
System.setProperty("spring.devtools.restart.enabled", "false")
|
||||
SpringApplication.run(MyApplication::class.java, *args)
|
||||
}
|
||||
class MyApplication
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
System.setProperty("spring.devtools.restart.enabled", "false")
|
||||
runApplication<MyApplication>(*args)
|
||||
}
|
||||
|
||||
|
||||
+1
-2
@@ -19,11 +19,10 @@ package org.springframework.boot.docs.using.usingthespringbootapplicationannotat
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication
|
||||
import org.springframework.boot.runApplication
|
||||
|
||||
// same as @SpringBootConfiguration @EnableAutoConfiguration @ComponentScan
|
||||
// Same as @SpringBootConfiguration @EnableAutoConfiguration @ComponentScan
|
||||
@SpringBootApplication
|
||||
class MyApplication
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
runApplication<MyApplication>(*args)
|
||||
}
|
||||
|
||||
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.docs.web.servlet.embeddedcontainer.applicationcontext
|
||||
|
||||
import jakarta.servlet.ServletContext
|
||||
import org.springframework.boot.context.event.ApplicationStartedEvent
|
||||
import org.springframework.context.ApplicationContext
|
||||
import org.springframework.context.ApplicationListener
|
||||
import org.springframework.web.context.WebApplicationContext
|
||||
|
||||
class MyDemoBean : ApplicationListener<ApplicationStartedEvent> {
|
||||
|
||||
@Suppress("unused")
|
||||
private var servletContext: ServletContext? = null
|
||||
|
||||
override fun onApplicationEvent(event: ApplicationStartedEvent) {
|
||||
val applicationContext: ApplicationContext = event.applicationContext
|
||||
this.servletContext = (applicationContext as WebApplicationContext).servletContext
|
||||
}
|
||||
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.docs.web.servlet.jersey
|
||||
|
||||
import jakarta.ws.rs.GET
|
||||
import jakarta.ws.rs.Path
|
||||
import org.springframework.stereotype.Component
|
||||
|
||||
@Component
|
||||
@Path("/hello")
|
||||
class MyEndpoint {
|
||||
|
||||
@GET
|
||||
fun message(): String {
|
||||
return "Hello"
|
||||
}
|
||||
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.docs.web.servlet.jersey
|
||||
|
||||
import org.glassfish.jersey.server.ResourceConfig
|
||||
import org.springframework.stereotype.Component
|
||||
|
||||
@Component
|
||||
class MyJerseyConfig : ResourceConfig() {
|
||||
|
||||
init {
|
||||
register(MyEndpoint::class.java)
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user