跳至主要内容

博文

目前显示的是 十月, 2017的博文

Java Remote Debug

When we finish the development and test in local environment, we will deploy our applications in remote server. We hope and believe it will work but we are always too optimistic. The application met different kinds of problems. In order to fix it, we sometimes need to access code directly in remote server container. Today, we will see how to do debug remotely. Remote Debug When we develop our application in local, we always using IDE to do it. We code and run and debug in IDE which provides much convenience. Even though we can debug application with jdb – a command line tools bundled into JDK, we may prefer to use IDE. So, we only cover the content of using IDE to debug here. If you are interested in using jdb , you may like this jdb tutorial . Runnable Jar In order to debug a remote JVM, we have to add some parameters to let JVM opening the debug port so that we can attach to it. The following is the command to start a runnable Jar : java "-agentlib:jdwp=transport=dt_so...

Learn Spring Expression Language

When reading the source code of some Spring based projects, we can see some code like following: @Value( "${env}" ) private int value ; and like following: @Autowired public void configure (MovieFinder movieFinder, @ Value ("#{ systemProperties[ 'user.region' ] } ") String defaultLocale) { this.movieFinder = movieFinder; this.defaultLocale = defaultLocale; } In this way, we can inject values from different sources very conveniently, and this is the features of Spring EL. What is Spring EL? How to use this handy feature to assist our developments? Today, we are going to learn some basics of Spring EL. Features The full name of Spring EL is Spring Expression Language, which exists in form of Java string and evaluated by Spring. It supports many syntax, from simple property access to complex safe navigation – method invocation when object is not null. And the following is the feature list from Spring EL document : ...