Posted by August 13, 2015
There are many cases nowadays when you have to go through HTTP proxy in order to access the internet. Eclipse provides an option to configure HTTP proxy settings – either by manual configuration or loading native system settings. (It does not support auto-configuration scripts, though, so if this is the way you configure your OS, you’ll have to provide proxy address to Eclipse manually.)
However. the settings configured via Eclipse preferences are not propagated to the Java programs that you develop. Obviously, you can provide proxy settings via VM arguments, but doing that for each and every run configuration may be painful. Fortunately, this can be solved with the help of “Default VM Arguments” setting under JRE/JDK definition. System properties configured there will be in effect for every Java program you are going to run or debug. Read the rest of this entry »
Posted in HOWTO | Tagged: Eclipse, HTTP, Java | Leave a Comment »
Posted by March 11, 2015
Long ago (long before the first post in this blog!) I’ve composed a list of cache-related HTTP headers, so I would not need to go through the trial-and-error process of guessing the right combination more than once. Recently I got another question about caching and it took me a lot of time to recall where I saw this list last time. So now I’m placing it here.
Please treat the explanations below as quick and incomplete summary. For full specification of “Pragma”, “Cache-Control” and “Expires” headers refer to HTTP/1.1 specification.
Caching in HTTP 1.1
Following directive does not prevent caching despite its name. It allows caching of the page, but specifies that the cache must ask the originating web server if the page is up-to-date before serving the cached version. So the cached page can still be served up if the originating web server says so. Applies to all caches.
Following directive tells the browser that the page has expired and must be treated as stale. Should be good news as long as the caches obey.
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Following directive specifies that the page contains information intended for a single user only and must not be cached by a shared cache (e.g. a proxy server).
Following directive specifies that a cache must not store any part of the response or the request that elicited it.
Following directive tells the cache that the maximum acceptable staleness of a page is 0 seconds.
Caching in HTTP 1.0
Following directive is the only cache control directive for HTTP 1.0, so use it in addition to any HTTP 1.1 cache control headers you include.
Read the rest of this entry »
Posted in HOWTO, Miscellaneous | Tagged: HTTP, Java | Leave a Comment »
Posted by February 15, 2015
Today I had to create a map in Spring XML configuration file, where both keys and values ought to be XML elements by their own. Obviously, using CDATA is the most readable way to achieve that – but it was not immediately clear how to use CDATA for entry’s key and value attributes.
Here is what I ended with:
Posted in HOWTO | Tagged: Java, Spring, XML | Leave a Comment »
Posted by January 26, 2015
Unlike the early Eclipse days, now most of Eclipse plugins are distributed via Update Manager. Installation of new software is only a few clicks away – unless your development environment is not connected to the internet! Some vendors publish update site archives for offline use, but most of them are not. Eclipse tries to provide a solution for that with site mirroring, but is not as easy as it could be and forces you to install full-fledged Eclipse on a machine connected to the internet. So, what can you do about it?
Let’s take run-jetty-run – excellent plugin that allows you to run Jetty in Eclipse with a single click, including source attachment for debugging, – and prepare an offline update site for it. Read the rest of this entry »
Posted in HOWTO | Tagged: Eclipse, Java, Jetty, Maven | Leave a Comment »
Posted by November 13, 2014
For many years I’m using Adobe Acrobat Reader to read PDF documents. Recently I started getting an annoying popup prompt for my Adobe ID while opening PDFs. I don’t have one and don’t plan to get one – it is just useless to me at this point.
Here is the way to get rid of this prompt:
- Open Registry Editor (and be extra careful there!)
- Go to “HKEY_CURRENT_USER\Software\Adobe\Acrobat Reader\11.0\Workflows” (if you don’t have “Workflows” key, just create one)
- Create new “DWORD (32-bit)” Value with name “bEnableAcrobatHS” and value “0”
That’s all – short and simple!
Read the rest of this entry »
Posted in HOWTO | Tagged: Adobe, Windows | 6 Comments »