Code Breeze !
- Website
- shengwangi.blogspot.de · all feeds from this site
- Feed URL
https://shengwangi.blogspot.com/feeds/posts/default
Read it in your FeedListing reader
Or add to: Feedly Inoreader Raw feed
Latest posts
-
Pitfall when using hibernate + date in entity
It’s a frequently encountered pitfall when using hibernate, also has entity with properties type defined as java.util.Date. In short, although the entity’s property is defined as java.util.Date in entity class, but at runtime hibernate will never set it as java.util.Date, but…
-
Several useful cases for maven plugin “dependency”
The maven dependency plugin is very handy when trying to deal with following questions: What are the external artifacts involved in a maven project. (dependency:resolve) Find out how an artifact is introduced into a project. (dependency:tree) In a multi modules project, how…
-
How to security a website in public key infrastructure (PKI) – Basic Concept
Let’s suppose you are a owner of a website, which has domain name www.shengw.com Here is the flow and it’s basic idea behind it. CA’s role is to make sure the public key, PK1, that client used to to decode message is really belongs to www.shengw.com. Furthermore to prove any…
-
Use Fiddler to debug https request from java application
Fiddler is a very handy tool for http related debug. After starting, it automatically start to capture any http request go through system proxy. Also it by default listen to port 8888. For debug Java application, we stop the automatic capturing, only use the port 8888. This…
-
Use Fidder to debug http request from java application
Fiddler is a very handy tool for http related debug. After starting, it automatically start to capture any http request go through system proxy. Also it by default listen to port 8888. For debug Java application, we stop the automatic capturing, only use the port 8888. This…
-
Spring RestTemplate useful hints
RestTemplate a widely used client tool from Spring framework. Here are some useful hints when using Spring RestTemplate. How to use basic authentication with RestTemplate? How to add arbitrary Http header, e.g.”Content-Type”, “Accept”, with RestTemplate? How to bypass(not solve)…
-
Jersey in spring boot – Hello world example
Simply speaking: J AX-RS , namely Java API for RESTful Service, is from JSR 311 (obsolete) and JSR 339 (download here). Jersey is an reference implementation of JAX-RS. Spring boot sure can implement REST service without Jersey by using the controller way (@RestConroller). Also,…
-
How to dump all dependencies of a maven project
Although it's not common but it really happens in real life. Usually maven already automatically downloads all dependencies to local repository, and for some reason you want to get some or all dependency jar files of this project. For example you final package is a executable…
-
Understand <optional>true</optional> in maven dependency
In pom's dependency , sometimes there's true . What does this mean? Why and when do you need to set this? 1. Meaning of In short, if project D depend on project C, Project C optionally depend on project A, then project D do NOT depend on project A. Since project C has 2 classes…
-
liquibase - helloworld example
Liquibase is a dabasebase chane management tool. Rather than writing SQL directly against the database to create, update or drop database objects, developers define their desired database changes in XML files. Any change to database are grouped into " ChangeSet ", the best…
-
How does spring's DispatcherServlet work
In Spring webmvc, there is a specifial servlet which is the portal between Servlet container and Spring webmvc framework. It's the DispatcherServlet. A spring web application usually maps all requst to this DispatcherServlet. A servlet's job is take in a HttpServletRequest, do…
-
What are default handlers/resolvers in Spring DispatcherServlet
Spring webmvc's DispatcherServlet rely on several important notions. HandlerMapping - find which controller's which method to process current http request. HandlerAdapter - use HandlerMapping's result, actually make performe the request handling, return a ModelAndView object…
-
How to use distributed JMeter to test netty server performance
JMeter is good at performance testing. Usually, we often need more than one hosts to send traffic to one server to see how the sever behaves. This Many-To-One test scenario is called distributed testing. In JMeter's world, the hosts, which generate traffic, are called ' jmeter…
-
Netty tutorial - hello world example
Netty is a NIO client server framework which enables quick and easy development of network applications. In this tutorial the basic concepts of Netty are introduced, as well as a hello world level example. This hello world example, based on Netty 4, has a server and a client,…
-
Hello world Spark example
In this article, there is 3 hello world level demos. The difference is where does the spark get its input data. The first one, spark get its input data from external socket server. This method is often used in testing or developing phase. The second demo, spark get its input…
-
How to send message to Flume (avro or thrift) in Java
Apache Flume is mostly used to transfer data from "Out-of-Hadoop" world into Hadoop family. In Flume, every message transfered is called ' Event ', input is call " Source ", output is called " Sink ". 1. Flume Source & Sink type Flume has many input and output types. Here are…
-
Java-based Spring mvc configuration - with Spring security
This article need you already understand how to config Spring mvc in java-based configuration without Spring security. If not, check this article first on " Java-based Spring mvc configuration - without Spring security " This article is a hello world level spring mvc application…
-
Replace jpa persistence.xml with java based configuration in Spring
Jpa 's /META/INF/persistence.xml with transaction-type set "RESOURCE_LOCAL" can be replace in spring configuration. The demo persistence.xml looks like below. org.hibernate.ejb.HibernatePersistence …
-
Java-based Spring mvc configuration - without Spring security
Spring 3+ supports using java-based configuration in replacement of the tradictional web.xml. You can replace web.xml with any class which implments interface org.springframework.web. WebApplicationInitializer ( which only has one onStartup() method). Usually all you need to…
-
How to separate integration test from unit test
0. Environment Maven 3.2 + Eclipse JUnit 4.+ This article supposes you already know how to use maven plugin failsafe for integration test. 1. Final goal Let's clarify the word "separate" first. It means: Unit tests and integration tests are in different directories, but stay in…