This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
. ____ _ __ _ _ | |
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ | |
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ | |
\\/ ___)| |_)| | | | | || (_| | ) ) ) ) | |
' |____| .__|_| |_|_| |_\__, | / / / / | |
=========|_|==============|___/=/_/_/_/ | |
:: Spring Boot :: (v1.4.0.BUILD-SNAPSHOT) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.moelholm; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.stereotype.Service; | |
@Service | |
public class GreeterService { | |
@Autowired | |
@Uppercase("hElLo WoRlD") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This example shows why we could use @Nonbinding like support in Qualifier annotations (as known from CDI) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Failed experiment: Attempting to force datetimes to be written/loaded using the UTC time zone. | |
* | |
* | |
* Good: OffsetDateTime is successfully converted into a "normal" Temporal data type ( here Calendar ) - resulting in Timestamp DDL etc. | |
* | |
* Bad : Datetimes are still stored using the JVM default time zone. ( In my part of the world: UTC+1 right now ) | |
* | |
* The working solution I can come up with right now is setting the entire JVM into the UTC time zone. That surely does the job: Datetimes | |
* in the database show up as UTC versions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Hello { | |
public static void main(String[] args) { | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.springframework.http.MediaType; | |
import org.springframework.http.client.reactive.ReactorClientHttpConnector; | |
import org.springframework.web.bind.annotation.RequestMapping; | |
import org.springframework.web.bind.annotation.RestController; | |
import org.springframework.web.client.reactive.WebClient; | |
import reactor.core.publisher.Mono; | |
import static org.springframework.web.client.reactive.ClientWebRequestBuilders.get; | |
import static org.springframework.web.client.reactive.ResponseExtractors.body; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RunWith(WildFlyEmbeddedArquillianRunner.class) | |
public class MultiDeploymentIntegrationTest { | |
@Deployment(name = "myapp", order = 1) | |
public static EnterpriseArchive createEar() { | |
return ShrinkWrap.create(EnterpriseArchive.class, "myapp.ear") | |
.addAsModule( | |
ShrinkWrap.create(JavaArchive.class, "myejbmodule.jar") | |
.addClass(BusinessServiceBean.class) | |
.addClass(AnotherBusinessServiceBean.class) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
logback-core 1.1.7 | |
logback-classic 1.1.7 | |
Spring Boot cfg...: | |
# Log configuration file | |
logging.config=classpath:logback-for-server.xml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static final Charset WINDOWS_1252_CHARSET = Charset.forName("Windows-1252"); | |
// Can below be done more effectively (/robust/secure) ? | |
@Test | |
public void test() { | |
// Given | |
String inputString = "ĢoogleŰberButÅ"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Gets a bean from the Spring context - stripping the proxy (if any). | |
* | |
* @param clazz type of the bean to find | |
* @return the bean (not a proxy) | |
*/ | |
protected <T> T getBeanWithoutProxy(Class<T> clazz) { | |
T bean = applicationContext.getBean(clazz); | |
if (AopUtils.isAopProxy(bean) && bean instanceof Advised) { | |
try { |
OlderNewer